@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
@@ -4,10 +4,10 @@ import { Button } from "../components/ui/button.js";
4
4
  import LoadingCentered_default from "../components/feedback/LoadingCentered.js";
5
5
  import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
6
6
  import { require_enums } from "../packages/contracts/dist/enums/index.js";
7
- import WorkflowItem_default from "../features/workbench/WorkflowItem.js";
8
7
  import { ReactFlowProvider } from "../node_modules/@xyflow/react/dist/esm/index.js";
9
8
  import WorkflowFlowViewer_default from "../features/debug/components/WorkflowFlowViewer.js";
10
9
  import "../features/debug/index.js";
10
+ import WorkflowItem_default from "../features/workbench/WorkflowItem.js";
11
11
  import WorkflowHistoryList_default from "../features/workbench/components/WorkflowHistoryList.js";
12
12
  import { NewRunDialog } from "../features/workbench/components/NewRunDialog.js";
13
13
  import "../features/workbench/index.js";
@@ -307,30 +307,27 @@ function stripAnsi(e) {
307
307
  return e.replace(/\x1b\[[0-9;]*m/g, "");
308
308
  }
309
309
  function LogLine(e) {
310
- let t = c(14), { line: n, index: r } = e, i, a, o;
311
- if (t[0] !== n) {
312
- i = stripAnsi(n);
313
- let e;
314
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (e = /\bERROR\b/, t[4] = e) : e = t[4], a = e.test(i), o = /\bWARN\b/.test(i) || /\b(Warning|WARNING|DeprecationWarning)\b/.test(i), t[0] = n, t[1] = i, t[2] = a, t[3] = o;
315
- } else i = t[1], a = t[2], o = t[3];
310
+ let t = c(13), { line: n, index: r } = e, i, a, o;
311
+ t[0] === n ? (i = t[1], a = t[2], o = t[3]) : (i = stripAnsi(n), a = /\bERROR\b/.test(i), o = /\bWARN\b/.test(i) || /\b(Warning|WARNING|DeprecationWarning)\b/.test(i), t[0] = n, t[1] = i, t[2] = a, t[3] = o);
316
312
  let s = o, l = `group flex border-b border-border/30 hover:bg-accent/30 ${a ? "bg-destructive/5" : s ? "bg-yellow-500/5" : ""}`, u = r + 1, d;
317
- t[5] === u ? d = t[6] : (d = /* @__PURE__ */ jsx("span", {
313
+ t[4] === u ? d = t[5] : (d = /* @__PURE__ */ jsx("span", {
318
314
  className: "w-10 shrink-0 select-none border-r border-border/30 px-2 py-0.5 text-right text-[10px] text-muted-foreground/50",
319
315
  children: u
320
- }), t[5] = u, t[6] = d);
316
+ }), t[4] = u, t[5] = d);
321
317
  let f = `flex-1 px-3 py-0.5 text-[11px] leading-5 font-mono ${a ? "text-destructive" : s ? "text-yellow-600 dark:text-yellow-400" : ""}`, p;
322
- t[7] !== i || t[8] !== f ? (p = /* @__PURE__ */ jsx("span", {
318
+ t[6] !== i || t[7] !== f ? (p = /* @__PURE__ */ jsx("span", {
323
319
  className: f,
324
320
  children: i
325
- }), t[7] = i, t[8] = f, t[9] = p) : p = t[9];
321
+ }), t[6] = i, t[7] = f, t[8] = p) : p = t[8];
326
322
  let m;
327
- return t[10] !== l || t[11] !== d || t[12] !== p ? (m = /* @__PURE__ */ jsxs("div", {
323
+ return t[9] !== l || t[10] !== d || t[11] !== p ? (m = /* @__PURE__ */ jsxs("div", {
328
324
  className: l,
329
325
  children: [d, p]
330
- }), t[10] = l, t[11] = d, t[12] = p, t[13] = m) : m = t[13], m;
326
+ }), t[9] = l, t[10] = d, t[11] = p, t[12] = m) : m = t[12], m;
331
327
  }
332
328
  function EmbedLogsContent() {
333
- let e = useRef(null), t = useQuery({
329
+ let e = c(21), t = useRef(null), n;
330
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (n = {
334
331
  queryKey: ["remote-agent-app-logs"],
335
332
  queryFn: async () => {
336
333
  let e = await fetch("http://localhost:8000/api/v1/app/logs?lines=200", { credentials: "include" });
@@ -341,51 +338,72 @@ function EmbedLogsContent() {
341
338
  return await e.json();
342
339
  },
343
340
  refetchInterval: 5e3
344
- });
345
- useEffect(() => {
346
- e.current?.scrollIntoView({ behavior: "smooth" });
347
- }, [t.data]);
348
- let n = useMemo(() => {
349
- let e = [];
350
- return t.data?.stdout && e.push(t.data.stdout), t.data?.stderr && e.push(t.data.stderr), e.join("\n").split("\n").filter((e) => e.length > 0);
351
- }, [t.data]);
352
- return /* @__PURE__ */ jsxs("div", {
353
- className: "flex h-full flex-col",
354
- children: [/* @__PURE__ */ jsxs("div", {
355
- className: "flex h-9 shrink-0 items-center justify-between border-b bg-muted/30 px-3",
356
- children: [/* @__PURE__ */ jsx("span", {
357
- className: "text-xs font-medium text-muted-foreground",
358
- children: "Application Logs"
359
- }), /* @__PURE__ */ jsx("button", {
360
- onClick: () => void t.refetch(),
361
- className: `text-muted-foreground hover:text-foreground rounded-md p-1 transition-colors hover:cursor-pointer ${t.isFetching ? "animate-spin" : ""}`,
362
- children: /* @__PURE__ */ jsx(RefreshCw, { className: "h-3 w-3" })
363
- })]
364
- }), /* @__PURE__ */ jsx("div", {
365
- className: "flex-1 overflow-auto bg-background",
366
- children: t.isLoading && !t.data ? /* @__PURE__ */ jsx("div", {
367
- className: "flex justify-center py-8",
368
- children: /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground h-4 w-4 animate-spin" })
369
- }) : t.error ? /* @__PURE__ */ jsx("div", {
370
- className: "px-4 py-3",
371
- children: /* @__PURE__ */ jsxs("p", {
372
- className: "text-sm text-destructive",
373
- children: ["Error: ", t.error.message]
374
- })
375
- }) : n.length > 0 ? /* @__PURE__ */ jsxs("div", {
376
- className: "font-mono",
377
- children: [n.map((e, t) => /* @__PURE__ */ jsx(LogLine, {
378
- line: e,
379
- index: t
380
- }, t)), /* @__PURE__ */ jsx("div", { ref: e })]
381
- }) : /* @__PURE__ */ jsxs("div", {
382
- className: "flex flex-col items-center justify-center gap-2 py-8 text-muted-foreground",
383
- children: [/* @__PURE__ */ jsx(ScrollText, { className: "h-5 w-5" }), /* @__PURE__ */ jsx("span", {
384
- className: "text-xs",
385
- children: "No logs available"
386
- })]
387
- })
341
+ }, e[0] = n) : n = e[0];
342
+ let r = useQuery(n), i;
343
+ e[1] === Symbol.for("react.memo_cache_sentinel") ? (i = () => {
344
+ t.current?.scrollIntoView({ behavior: "smooth" });
345
+ }, e[1] = i) : i = e[1];
346
+ let a;
347
+ e[2] === r.data ? a = e[3] : (a = [r.data], e[2] = r.data, e[3] = a), useEffect(i, a);
348
+ let o;
349
+ if (e[4] !== r.data) {
350
+ let t = [];
351
+ r.data?.stdout && t.push(r.data.stdout), r.data?.stderr && t.push(r.data.stderr), o = t.join("\n").split("\n").filter(_temp3), e[4] = r.data, e[5] = o;
352
+ } else o = e[5];
353
+ let s = o, l;
354
+ e[6] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ jsx("span", {
355
+ className: "text-xs font-medium text-muted-foreground",
356
+ children: "Application Logs"
357
+ }), e[6] = l) : l = e[6];
358
+ let u;
359
+ e[7] === r ? u = e[8] : (u = () => void r.refetch(), e[7] = r, e[8] = u);
360
+ let d = `text-muted-foreground hover:text-foreground rounded-md p-1 transition-colors hover:cursor-pointer ${r.isFetching ? "animate-spin" : ""}`, f;
361
+ e[9] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ jsx(RefreshCw, { className: "h-3 w-3" }), e[9] = f) : f = e[9];
362
+ let p;
363
+ e[10] !== u || e[11] !== d ? (p = /* @__PURE__ */ jsxs("div", {
364
+ className: "flex h-9 shrink-0 items-center justify-between border-b bg-muted/30 px-3",
365
+ children: [l, /* @__PURE__ */ jsx("button", {
366
+ onClick: u,
367
+ className: d,
368
+ children: f
388
369
  })]
389
- });
370
+ }), e[10] = u, e[11] = d, e[12] = p) : p = e[12];
371
+ let m;
372
+ e[13] !== s || e[14] !== r.data || e[15] !== r.error || e[16] !== r.isLoading ? (m = /* @__PURE__ */ jsx("div", {
373
+ className: "flex-1 overflow-auto bg-background",
374
+ children: r.isLoading && !r.data ? /* @__PURE__ */ jsx("div", {
375
+ className: "flex justify-center py-8",
376
+ children: /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground h-4 w-4 animate-spin" })
377
+ }) : r.error ? /* @__PURE__ */ jsx("div", {
378
+ className: "px-4 py-3",
379
+ children: /* @__PURE__ */ jsxs("p", {
380
+ className: "text-sm text-destructive",
381
+ children: ["Error: ", r.error.message]
382
+ })
383
+ }) : s.length > 0 ? /* @__PURE__ */ jsxs("div", {
384
+ className: "font-mono",
385
+ children: [s.map(_temp4), /* @__PURE__ */ jsx("div", { ref: t })]
386
+ }) : /* @__PURE__ */ jsxs("div", {
387
+ className: "flex flex-col items-center justify-center gap-2 py-8 text-muted-foreground",
388
+ children: [/* @__PURE__ */ jsx(ScrollText, { className: "h-5 w-5" }), /* @__PURE__ */ jsx("span", {
389
+ className: "text-xs",
390
+ children: "No logs available"
391
+ })]
392
+ })
393
+ }), e[13] = s, e[14] = r.data, e[15] = r.error, e[16] = r.isLoading, e[17] = m) : m = e[17];
394
+ let g;
395
+ return e[18] !== p || e[19] !== m ? (g = /* @__PURE__ */ jsxs("div", {
396
+ className: "flex h-full flex-col",
397
+ children: [p, m]
398
+ }), e[18] = p, e[19] = m, e[20] = g) : g = e[20], g;
399
+ }
400
+ function _temp4(e, t) {
401
+ return /* @__PURE__ */ jsx(LogLine, {
402
+ line: e,
403
+ index: t
404
+ }, t);
405
+ }
406
+ function _temp3(e) {
407
+ return e.length > 0;
390
408
  }
391
409
  export { PreviewWorkbenchPage as default };
@@ -6,59 +6,45 @@ import Runs_default from "../features/runs/Runs.js";
6
6
  import { c } from "react/compiler-runtime";
7
7
  import { useState } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
- import { Home, Play } from "lucide-react";
9
+ import { Play } from "lucide-react";
10
10
  function RunsListPage() {
11
- let f = c(19), { router: p } = useStudio(), [m, h] = useState(!1), g;
12
- f[0] === p ? g = f[1] : (g = p.getDashboard(), f[0] = p, f[1] = g);
13
- let _;
14
- f[2] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ jsx(Home, { className: "h-4 w-4" }), f[2] = _) : _ = f[2];
15
- let v;
16
- f[3] === g ? v = f[4] : (v = {
17
- label: "Dashboard",
18
- href: g,
19
- icon: _
20
- }, f[3] = g, f[4] = v);
21
- let y;
22
- f[5] === Symbol.for("react.memo_cache_sentinel") ? (y = {
11
+ let d = c(9), { router: f } = useStudio(), [p, m] = useState(!1), h;
12
+ d[0] === Symbol.for("react.memo_cache_sentinel") ? (h = [{
23
13
  label: "Runs",
24
14
  current: !0
25
- }, f[5] = y) : y = f[5];
26
- let b;
27
- f[6] === v ? b = f[7] : (b = [v, y], f[6] = v, f[7] = b);
28
- let x = b, S;
29
- f[8] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ jsx("h1", {
15
+ }], d[0] = h) : h = d[0];
16
+ let g = h, _;
17
+ d[1] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ jsx("h1", {
30
18
  className: "text-3xl font-bold tracking-tight",
31
19
  children: "Runs"
32
- }), f[8] = S) : S = f[8];
33
- let C, w;
34
- f[9] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsxs("div", {
20
+ }), d[1] = _) : _ = d[1];
21
+ let v, y;
22
+ d[2] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ jsxs("div", {
35
23
  className: "mb-4 flex items-center justify-between",
36
- children: [S, /* @__PURE__ */ jsxs(Button, {
24
+ children: [_, /* @__PURE__ */ jsxs(Button, {
37
25
  variant: "default",
38
26
  size: "sm",
39
27
  className: "gap-1.5",
40
- onClick: () => h(!0),
28
+ onClick: () => m(!0),
41
29
  children: [/* @__PURE__ */ jsx(Play, { className: "h-3.5 w-3.5" }), "New Run"]
42
30
  })]
43
- }), w = /* @__PURE__ */ jsx(Runs_default, {}), f[9] = C, f[10] = w) : (C = f[9], w = f[10]);
44
- let T;
45
- f[11] === p ? T = f[12] : (T = (r) => {
46
- h(!1), p.navigateToWorkflow(r);
47
- }, f[11] = p, f[12] = T);
48
- let E;
49
- f[13] !== m || f[14] !== T ? (E = /* @__PURE__ */ jsx(NewRunDialog, {
50
- open: m,
51
- onOpenChange: h,
52
- onSuccess: T
53
- }), f[13] = m, f[14] = T, f[15] = E) : E = f[15];
54
- let D;
55
- return f[16] !== x || f[17] !== E ? (D = /* @__PURE__ */ jsxs(MainLayout_default, {
56
- breadcrumbsData: x,
31
+ }), y = /* @__PURE__ */ jsx(Runs_default, {}), d[2] = v, d[3] = y) : (v = d[2], y = d[3]);
32
+ let b;
33
+ d[4] === f ? b = d[5] : (b = (e) => {
34
+ m(!1), f.navigateToWorkflow(e);
35
+ }, d[4] = f, d[5] = b);
36
+ let x;
37
+ return d[6] !== p || d[7] !== b ? (x = /* @__PURE__ */ jsxs(MainLayout_default, {
38
+ breadcrumbsData: g,
57
39
  children: [
58
- C,
59
- w,
60
- E
40
+ v,
41
+ y,
42
+ /* @__PURE__ */ jsx(NewRunDialog, {
43
+ open: p,
44
+ onOpenChange: m,
45
+ onSuccess: b
46
+ })
61
47
  ]
62
- }), f[16] = x, f[17] = E, f[18] = D) : D = f[18], D;
48
+ }), d[6] = p, d[7] = b, d[8] = x) : x = d[8], x;
63
49
  }
64
50
  export { RunsListPage as default };
@@ -3,47 +3,32 @@ import MainLayout_default from "../components/layout/MainLayout.js";
3
3
  import Runs_default from "../features/runs/Runs.js";
4
4
  import { c } from "react/compiler-runtime";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
- import { Home } from "lucide-react";
7
6
  function RunsPage() {
8
- let s = c(17), { 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] === l ? p = s[6] : (p = l.getRuns(), s[5] = l, s[6] = p);
20
- let m;
21
- s[7] === p ? m = s[8] : (m = {
7
+ let o = c(11), { router: s } = useStudio(), l;
8
+ o[0] === s ? l = o[1] : (l = s.getRuns(), o[0] = s, o[1] = l);
9
+ let u;
10
+ o[2] === l ? u = o[3] : (u = {
22
11
  label: "Runs",
23
- href: p
24
- }, s[7] = p, s[8] = m);
25
- let h;
26
- s[9] === Symbol.for("react.memo_cache_sentinel") ? (h = {
12
+ href: l
13
+ }, o[2] = l, o[3] = u);
14
+ let d;
15
+ o[4] === Symbol.for("react.memo_cache_sentinel") ? (d = {
27
16
  label: "Action Required",
28
17
  current: !0
29
- }, s[9] = h) : h = s[9];
30
- let g;
31
- s[10] !== f || s[11] !== m ? (g = [
32
- f,
33
- m,
34
- h
35
- ], s[10] = f, s[11] = m, s[12] = g) : g = s[12];
36
- let _ = g, v;
37
- s[13] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ jsx("h1", {
18
+ }, o[4] = d) : d = o[4];
19
+ let f;
20
+ o[5] === u ? f = o[6] : (f = [u, d], o[5] = u, o[6] = f);
21
+ let p = f, m;
22
+ o[7] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ jsx("h1", {
38
23
  className: "mb-4 text-3xl font-bold tracking-tight",
39
24
  children: "Action Required"
40
- }), s[13] = v) : v = s[13];
41
- let y;
42
- s[14] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ jsx(Runs_default, { defaultFilters: { status: "paused" } }), s[14] = y) : y = s[14];
43
- let b;
44
- return s[15] === _ ? b = s[16] : (b = /* @__PURE__ */ jsxs(MainLayout_default, {
45
- breadcrumbsData: _,
46
- children: [v, y]
47
- }), s[15] = _, s[16] = b), b;
25
+ }), o[7] = m) : m = o[7];
26
+ let h;
27
+ o[8] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ jsx(Runs_default, { defaultFilters: { status: "paused" } }), o[8] = h) : h = o[8];
28
+ let g;
29
+ return o[9] === p ? g = o[10] : (g = /* @__PURE__ */ jsxs(MainLayout_default, {
30
+ breadcrumbsData: p,
31
+ children: [m, h]
32
+ }), o[9] = p, o[10] = g), g;
48
33
  }
49
34
  export { RunsPage as default };
@@ -3,90 +3,68 @@ import { useWorkflow } from "../hooks/useWorkflows.js";
3
3
  import { useWorkspace } from "../hooks/useWorkspaces.js";
4
4
  import LoadingCentered_default from "../components/feedback/LoadingCentered.js";
5
5
  import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
6
+ import { useDefaultEnvironmentPreviewUrl } from "../hooks/useEnvironmentPreviewUrl.js";
6
7
  import Workbench from "../features/workbench/Workbench.js";
7
8
  import "../features/workbench/index.js";
8
9
  import { requireParam } from "../lib/requireParam.js";
9
10
  import { c } from "react/compiler-runtime";
10
- import { useCallback, useMemo } from "react";
11
+ import { useMemo } from "react";
11
12
  import { jsx, jsxs } from "react/jsx-runtime";
12
13
  import { useParams } from "react-router-dom";
13
- import { Home } from "lucide-react";
14
- function WorkbenchPage(m) {
15
- let h = c(45), g;
16
- h[0] === m ? g = h[1] : (g = m === void 0 ? {} : m, h[0] = m, h[1] = g);
17
- let { previewPanelOpen: _, onPreviewPanelOpenChange: v, isDeveloperMode: y, getPreviewUrl: b, getEnvironmentPreviewUrl: x, environments: S } = g, { router: C } = useStudio(), w = useParams(), T;
18
- h[2] === w ? T = h[3] : (T = requireParam(w, "workflowId"), h[2] = w, h[3] = T);
19
- let E = useWorkflow(T), D = E.data?.workspaceId, O = useWorkspace(D);
20
- O.data?.environments;
21
- let k = S ?? O.data?.environments, A = x ?? _temp, j;
22
- h[4] === C ? j = h[5] : (j = C.getDashboard(), h[4] = C, h[5] = j);
14
+ function WorkbenchPage(p) {
15
+ let m = c(36), h;
16
+ m[0] === p ? h = m[1] : (h = p === void 0 ? {} : p, m[0] = p, m[1] = h);
17
+ let { getPreviewUrl: g, getEnvironmentPreviewUrl: _, environments: v } = h, { router: y } = useStudio(), b = useParams(), x;
18
+ m[2] === b ? x = m[3] : (x = requireParam(b, "workflowId"), m[2] = b, m[3] = x);
19
+ let S = useWorkflow(x), C = S.data?.workspaceId, w = useWorkspace(C);
20
+ w.data?.environments;
21
+ let T = v ?? w.data?.environments, E = useDefaultEnvironmentPreviewUrl(), D = _ ?? E, O;
22
+ m[4] === y ? O = m[5] : (O = y.getWorkspaces(), m[4] = y, m[5] = O);
23
+ let k;
24
+ m[6] === O ? k = m[7] : (k = {
25
+ label: "Workspaces",
26
+ href: O
27
+ }, m[6] = O, m[7] = k);
28
+ let A = w.data?.title ?? "", j;
29
+ m[8] !== y || m[9] !== C ? (j = C ? y.getWorkspace(C) : void 0, m[8] = y, m[9] = C, m[10] = j) : j = m[10];
23
30
  let M;
24
- h[6] === Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ jsx(Home, { className: "h-4 w-4" }), h[6] = M) : M = h[6];
25
- let N;
26
- h[7] === j ? N = h[8] : (N = {
27
- label: "Dashboard",
28
- href: j,
29
- icon: M
30
- }, h[7] = j, h[8] = N);
31
- let P;
32
- h[9] === C ? P = h[10] : (P = C.getWorkspaces(), h[9] = C, h[10] = P);
31
+ m[11] !== A || m[12] !== j ? (M = {
32
+ label: A,
33
+ href: j
34
+ }, m[11] = A, m[12] = j, m[13] = M) : M = m[13];
35
+ let N = `Run #${S.data?.run}${S.data?.title ? ` (${S.data.title})` : ""}`, P;
36
+ m[14] === N ? P = m[15] : (P = { label: N }, m[14] = N, m[15] = P);
33
37
  let F;
34
- h[11] === P ? F = h[12] : (F = {
35
- label: "Workspaces",
36
- href: P
37
- }, h[11] = P, h[12] = F);
38
- let I = O.data?.title ?? "", L;
39
- h[13] !== C || h[14] !== D ? (L = D ? C.getWorkspace(D) : void 0, h[13] = C, h[14] = D, h[15] = L) : L = h[15];
38
+ m[16] !== k || m[17] !== M || m[18] !== P ? (F = [
39
+ k,
40
+ M,
41
+ P
42
+ ], m[16] = k, m[17] = M, m[18] = P, m[19] = F) : F = m[19];
43
+ let I = F, L;
44
+ m[20] === S.error ? L = m[21] : (L = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: S.error }), m[20] = S.error, m[21] = L);
40
45
  let R;
41
- h[16] !== I || h[17] !== L ? (R = {
42
- label: I,
43
- href: L
44
- }, h[16] = I, h[17] = L, h[18] = R) : R = h[18];
45
- let z = `Run #${E.data?.run}${E.data?.title ? ` (${E.data.title})` : ""}`, B;
46
- h[19] === z ? B = h[20] : (B = { label: z }, h[19] = z, h[20] = B);
47
- let V;
48
- h[21] !== R || h[22] !== B || h[23] !== N || h[24] !== F ? (V = [
49
- N,
50
- F,
51
- R,
52
- B
53
- ], h[21] = R, h[22] = B, h[23] = N, h[24] = F, h[25] = V) : V = h[25];
54
- let H = V, U;
55
- h[26] === E.error ? U = h[27] : (U = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: E.error }), h[26] = E.error, h[27] = U);
56
- let W;
57
- h[28] !== H || h[29] !== E.data || h[30] !== E.error || h[31] !== E.isLoading || h[32] !== b || h[33] !== y || h[34] !== v || h[35] !== _ || h[36] !== k || h[37] !== A ? (W = E.data ? /* @__PURE__ */ jsx(Workbench, {
58
- workflow: E.data,
59
- breadcrumbData: H,
60
- previewPanelOpen: _,
61
- onPreviewPanelOpenChange: v,
62
- isDeveloperMode: y,
63
- getPreviewUrl: b,
64
- getEnvironmentPreviewUrl: A,
65
- environments: k
66
- }) : !E.isLoading && !E.error ? /* @__PURE__ */ jsx("p", {
46
+ m[22] !== I || m[23] !== S.data || m[24] !== S.error || m[25] !== S.isLoading || m[26] !== g || m[27] !== T || m[28] !== D ? (R = S.data ? /* @__PURE__ */ jsx(Workbench, {
47
+ workflow: S.data,
48
+ breadcrumbData: I,
49
+ getPreviewUrl: g,
50
+ getEnvironmentPreviewUrl: D,
51
+ environments: T
52
+ }) : !S.isLoading && !S.error ? /* @__PURE__ */ jsx("p", {
67
53
  className: "text-muted-foreground py-8 text-center text-sm",
68
54
  children: "Workflow not found."
69
- }) : null, h[28] = H, h[29] = E.data, h[30] = E.error, h[31] = E.isLoading, h[32] = b, h[33] = y, h[34] = v, h[35] = _, h[36] = k, h[37] = A, h[38] = W) : W = h[38];
70
- let G;
71
- h[39] !== E.isLoading || h[40] !== W ? (G = /* @__PURE__ */ jsx(LoadingCentered_default, {
72
- loading: E.isLoading,
73
- children: W
74
- }), h[39] = E.isLoading, h[40] = W, h[41] = G) : G = h[41];
75
- let K;
76
- return h[42] !== U || h[43] !== G ? (K = /* @__PURE__ */ jsx("div", {
55
+ }) : null, m[22] = I, m[23] = S.data, m[24] = S.error, m[25] = S.isLoading, m[26] = g, m[27] = T, m[28] = D, m[29] = R) : R = m[29];
56
+ let z;
57
+ m[30] !== S.isLoading || m[31] !== R ? (z = /* @__PURE__ */ jsx(LoadingCentered_default, {
58
+ loading: S.isLoading,
59
+ children: R
60
+ }), m[30] = S.isLoading, m[31] = R, m[32] = z) : z = m[32];
61
+ let B;
62
+ return m[33] !== L || m[34] !== z ? (B = /* @__PURE__ */ jsx("div", {
77
63
  className: "flex h-svh flex-col",
78
64
  children: /* @__PURE__ */ jsxs("div", {
79
65
  className: "flex-1 overflow-hidden",
80
- children: [U, G]
66
+ children: [L, z]
81
67
  })
82
- }), h[42] = U, h[43] = G, h[44] = K) : K = h[44], K;
83
- }
84
- function _temp(t, f) {
85
- if (!t.connectionUrl) return "";
86
- let p = new URLSearchParams({
87
- url: t.connectionUrl,
88
- name: t.envName || t.workerId || ""
89
- });
90
- return f ? `/embed/env/preview/workflows/${f}?${p}` : `/embed/env/preview?${p}`;
68
+ }), m[33] = L, m[34] = z, m[35] = B) : B = m[35], B;
91
69
  }
92
70
  export { WorkbenchPage as default };