@loopstack/loopstack-studio 0.21.3 → 0.22.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 (86) hide show
  1. package/dist/api/auth.js +10 -0
  2. package/dist/api/client.js +13 -0
  3. package/dist/api/config.js +10 -0
  4. package/dist/api/dashboard.js +4 -0
  5. package/dist/api/documents.js +7 -0
  6. package/dist/api/index.js +24 -0
  7. package/dist/api/namespaces.js +7 -0
  8. package/dist/api/pipelines.js +13 -0
  9. package/dist/api/processor.js +4 -0
  10. package/dist/api/workflows.js +8 -0
  11. package/dist/api/workspaces.js +12 -0
  12. package/dist/app/EnvironmentEmbedRoot.js +33 -0
  13. package/dist/components/data-table/DataTableFilters.js +74 -63
  14. package/dist/components/layout/MainLayout.js +7 -4
  15. package/dist/components/page/PageBreadcrumbs.js +1 -1
  16. package/dist/components/ui/sidebar.js +359 -359
  17. package/dist/components/ui-widgets/UiActions.js +22 -15
  18. package/dist/components/ui-widgets/UiWidget.js +31 -26
  19. package/dist/components/ui-widgets/widgets/AiPromptInput.js +27 -27
  20. package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +12 -12
  21. package/dist/components/ui-widgets/widgets/SandboxRun.js +32 -0
  22. package/dist/components/ui-widgets/widgets/SubmitButton.js +11 -11
  23. package/dist/features/code-explorer/utils/fileIcons.js +4 -7
  24. package/dist/features/oauth/OAuthPromptRenderer.js +1 -1
  25. package/dist/features/runs/Runs.js +197 -0
  26. package/dist/features/workbench/NavigationItems.js +1 -1
  27. package/dist/features/workbench/Workbench.js +109 -75
  28. package/dist/features/workbench/WorkflowItem.js +8 -11
  29. package/dist/features/workbench/WorkflowList.js +29 -20
  30. package/dist/features/workbench/components/DocumentList.js +20 -20
  31. package/dist/features/workbench/components/NewRunDialog.js +328 -0
  32. package/dist/features/workbench/components/WorkbenchFloatingPanel.js +88 -0
  33. package/dist/features/workbench/components/WorkbenchFlowPanel.js +48 -0
  34. package/dist/features/workbench/components/WorkbenchIconSidebar.js +68 -0
  35. package/dist/features/workbench/components/WorkbenchPreviewPanel.js +128 -0
  36. package/dist/features/workbench/components/WorkflowForms.js +7 -6
  37. package/dist/features/workbench/components/WorkflowHistoryItem.js +68 -63
  38. package/dist/features/workbench/components/buttons/WorkflowButtons.js +79 -61
  39. package/dist/features/workbench/components/document-renderer/DocumentFormRenderer.js +6 -5
  40. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +77 -0
  41. package/dist/features/workspaces/Workspaces.js +2 -2
  42. package/dist/features/workspaces/components/CreateWorkspace.js +164 -81
  43. package/dist/features/workspaces/components/EnvironmentSlotSelector.js +63 -0
  44. package/dist/features/workspaces/components/ExecutionTimeline.js +69 -68
  45. package/dist/features/workspaces/components/PipelineForm.js +4 -4
  46. package/dist/hooks/index.js +2 -0
  47. package/dist/hooks/useApi.js +9 -33
  48. package/dist/hooks/useAuth.js +18 -38
  49. package/dist/hooks/useConfig.js +31 -33
  50. package/dist/hooks/useDashboard.js +1 -4
  51. package/dist/hooks/useDocuments.js +4 -8
  52. package/dist/hooks/useFiles.js +31 -41
  53. package/dist/hooks/useNamespaces.js +5 -8
  54. package/dist/hooks/usePipelines.js +98 -108
  55. package/dist/hooks/useProcessor.js +1 -4
  56. package/dist/hooks/useWorkflows.js +25 -41
  57. package/dist/hooks/useWorkspaces.js +45 -72
  58. package/dist/index.d.ts +266 -48
  59. package/dist/index.js +10 -2
  60. package/dist/packages/contracts/dist/enums/index.js +25 -0
  61. package/dist/packages/contracts/dist/enums/pipeline-state.js +10 -0
  62. package/dist/packages/contracts/dist/enums/registry.enum.js +20 -0
  63. package/dist/packages/contracts/dist/enums/sort-order.enum.js +10 -0
  64. package/dist/packages/contracts/dist/enums/user-type.enum.js +10 -0
  65. package/dist/packages/contracts/dist/enums/workflow-state.enum.js +10 -0
  66. package/dist/pages/DebugPage.js +12 -14
  67. package/dist/pages/DebugWorkflowDetailsPage.js +1 -1
  68. package/dist/pages/DebugWorkflowsPage.js +3 -4
  69. package/dist/pages/EmbedWorkbenchPage.js +4 -3
  70. package/dist/pages/PipelineDebugPage.js +2 -2
  71. package/dist/pages/PreviewWorkbenchPage.js +416 -0
  72. package/dist/pages/RunsListPage.js +36 -0
  73. package/dist/pages/RunsPage.js +49 -0
  74. package/dist/pages/StudioLandingPage.js +145 -0
  75. package/dist/pages/WorkbenchPage.js +75 -51
  76. package/dist/providers/InvalidationEventsProvider.js +7 -7
  77. package/dist/providers/QueryProvider.js +21 -0
  78. package/dist/routing/LocalRouter.js +9 -0
  79. package/dist/services/createApiClient.js +4 -10
  80. package/dist/services/index.js +1 -1
  81. package/package.json +2 -3
  82. package/dist/features/code-explorer/CodeExplorer.js +0 -69
  83. package/dist/features/code-explorer/components/CodeExplorerTree.js +0 -43
  84. package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +0 -82
  85. package/dist/features/workbench/components/WorkbenchSidebar.js +0 -109
  86. package/dist/features/workbench/providers/WorkbenchContextProvider.js +0 -3
@@ -3,22 +3,29 @@ import { c } from "react/compiler-runtime";
3
3
  import React, { Fragment } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  var UiActions_default = (i) => {
6
- let a = c(13), { actions: o, availableTransitions: s, disabled: l, onSubmit: u, isLoading: d } = i, f;
7
- if (a[0] !== o || a[1] !== s || a[2] !== l || a[3] !== d || a[4] !== u) {
6
+ let a = c(15), { actions: o, availableTransitions: s, currentPlace: l, disabled: u, onSubmit: d, isLoading: f } = i, p;
7
+ if (a[0] !== o || a[1] !== s || a[2] !== l || a[3] !== u || a[4] !== f || a[5] !== d) {
8
8
  let r;
9
- a[6] !== s || a[7] !== l || a[8] !== d || a[9] !== u ? (r = (r, i) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(UiWidget_default, {
10
- config: r,
11
- onSubmit: (e) => {
12
- u(r.transition, e);
13
- },
14
- disabled: l || r.transition === void 0 || !s.includes(r.transition),
15
- isLoading: d
16
- }) }, `ui-widget-${i}-${r.transition}`), a[6] = s, a[7] = l, a[8] = d, a[9] = u, a[10] = r) : r = a[10], f = o.map(r), a[0] = o, a[1] = s, a[2] = l, a[3] = d, a[4] = u, a[5] = f;
17
- } else f = a[5];
18
- let p;
19
- return a[11] === f ? p = a[12] : (p = /* @__PURE__ */ jsx("div", {
9
+ a[7] !== s || a[8] !== l || a[9] !== u || a[10] !== f || a[11] !== d ? (r = (r, i) => {
10
+ let { enabledWhen: a } = r, o = r.options?.transition;
11
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(UiWidget_default, {
12
+ config: r,
13
+ onSubmit: (e) => {
14
+ if (!o) {
15
+ console.error(`[UiActions] Widget "${r.widget ?? r.type}" has no transition configured.`);
16
+ return;
17
+ }
18
+ d(o, e);
19
+ },
20
+ disabled: u || a !== void 0 && (!l || !a.includes(l)) || o !== void 0 && !s.includes(o),
21
+ isLoading: f
22
+ }) }, `ui-widget-${i}-${o ?? r.widget}`);
23
+ }, a[7] = s, a[8] = l, a[9] = u, a[10] = f, a[11] = d, a[12] = r) : r = a[12], p = o.map(r), a[0] = o, a[1] = s, a[2] = l, a[3] = u, a[4] = f, a[5] = d, a[6] = p;
24
+ } else p = a[6];
25
+ let m;
26
+ return a[13] === p ? m = a[14] : (m = /* @__PURE__ */ jsx("div", {
20
27
  className: "flex w-full flex-col items-end gap-4",
21
- children: f
22
- }), a[11] = f, a[12] = p), p;
28
+ children: p
29
+ }), a[13] = p, a[14] = m), m;
23
30
  };
24
31
  export { UiActions_default as default };
@@ -1,43 +1,48 @@
1
1
  import AiPromptInput_default from "./widgets/AiPromptInput.js";
2
2
  import { ButtonFullWidth } from "./widgets/ButtonFullWidth.js";
3
+ import { SandboxRun } from "./widgets/SandboxRun.js";
3
4
  import { SubmitButton } from "./widgets/SubmitButton.js";
4
5
  import { c } from "react/compiler-runtime";
5
6
  import React from "react";
6
7
  import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
7
- var UiWidget_default = (o) => {
8
- let s = c(18), { config: l, onSubmit: u, disabled: d, isLoading: f } = o;
9
- switch (l.widget) {
8
+ var UiWidget_default = (s) => {
9
+ let l = c(18), { config: u, onSubmit: d, disabled: f, isLoading: p } = s, m = u.options;
10
+ switch (u.widget) {
10
11
  case "prompt-input": {
11
- let i;
12
- return s[0] !== l.options || s[1] !== l.transition || s[2] !== d || s[3] !== u ? (i = /* @__PURE__ */ jsx(AiPromptInput_default, {
13
- transition: l.transition,
14
- disabled: d,
15
- onSubmit: u,
16
- ui: l.options
17
- }), s[0] = l.options, s[1] = l.transition, s[2] = d, s[3] = u, s[4] = i) : i = s[4], i;
12
+ let a;
13
+ return l[0] !== f || l[1] !== d || l[2] !== m ? (a = /* @__PURE__ */ jsx(AiPromptInput_default, {
14
+ disabled: f,
15
+ onSubmit: d,
16
+ ui: m
17
+ }), l[0] = f, l[1] = d, l[2] = m, l[3] = a) : a = l[3], a;
18
18
  }
19
19
  case "button": {
20
- let e = l.options, i;
21
- return s[5] !== l.transition || s[6] !== d || s[7] !== f || s[8] !== u || s[9] !== e ? (i = /* @__PURE__ */ jsx(SubmitButton, {
22
- transition: l.transition,
20
+ let e = m, a;
21
+ return l[4] !== f || l[5] !== p || l[6] !== d || l[7] !== e ? (a = /* @__PURE__ */ jsx(SubmitButton, {
23
22
  ui: e,
24
- disabled: d,
25
- onClick: u,
26
- isLoading: f
27
- }), s[5] = l.transition, s[6] = d, s[7] = f, s[8] = u, s[9] = e, s[10] = i) : i = s[10], i;
23
+ disabled: f,
24
+ onClick: d,
25
+ isLoading: p
26
+ }), l[4] = f, l[5] = p, l[6] = d, l[7] = e, l[8] = a) : a = l[8], a;
28
27
  }
29
28
  case "button-full-w": {
30
- let e = l.options, a;
31
- return s[11] !== l.transition || s[12] !== d || s[13] !== f || s[14] !== u || s[15] !== e ? (a = /* @__PURE__ */ jsx(ButtonFullWidth, {
32
- transition: l.transition,
29
+ let e = m, o;
30
+ return l[9] !== f || l[10] !== p || l[11] !== d || l[12] !== e ? (o = /* @__PURE__ */ jsx(ButtonFullWidth, {
33
31
  ui: e,
34
- disabled: d,
35
- onClick: u,
36
- isLoading: f
37
- }), s[11] = l.transition, s[12] = d, s[13] = f, s[14] = u, s[15] = e, s[16] = a) : a = s[16], a;
32
+ disabled: f,
33
+ onClick: d,
34
+ isLoading: p
35
+ }), l[9] = f, l[10] = p, l[11] = d, l[12] = e, l[13] = o) : o = l[13], o;
36
+ }
37
+ case "sandbox-run": {
38
+ let e = m, a;
39
+ return l[14] !== f || l[15] !== e ? (a = /* @__PURE__ */ jsx(SandboxRun, {
40
+ ui: e,
41
+ disabled: f
42
+ }), l[14] = f, l[15] = e, l[16] = a) : a = l[16], a;
38
43
  }
39
44
  }
40
- let p;
41
- return s[17] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ jsx(Fragment$1, {}), s[17] = p) : p = s[17], p;
45
+ let h;
46
+ return l[17] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ jsx(Fragment$1, {}), l[17] = h) : h = l[17], h;
42
47
  };
43
48
  export { UiWidget_default as default };
@@ -4,40 +4,40 @@ import { useState } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Pill } from "lucide-react";
6
6
  function AiPromptInput(d) {
7
- let f = c(18), { transition: p, onSubmit: m, disabled: h, ui: g } = d, [_, v] = useState(""), y = g?.label ?? p, b;
8
- f[0] === m ? b = f[1] : (b = (e, u) => {
9
- u.preventDefault(), e.text && (m(e.text), v(""));
10
- }, f[0] = m, f[1] = b);
11
- let x;
12
- f[2] === Symbol.for("react.memo_cache_sentinel") ? (x = (e) => v(e.target.value), f[2] = x) : x = f[2];
13
- let S = h || !1, C;
14
- f[3] !== _ || f[4] !== S ? (C = /* @__PURE__ */ jsx(PromptInputBody, { children: /* @__PURE__ */ jsx(PromptInputTextarea, {
15
- value: _,
16
- onChange: x,
7
+ let f = c(18), { onSubmit: p, disabled: m, ui: h } = d, [g, _] = useState(""), v = h?.label ?? "Submit", y;
8
+ f[0] === p ? y = f[1] : (y = (e, u) => {
9
+ u.preventDefault(), e.text && (p(e.text), _(""));
10
+ }, f[0] = p, f[1] = y);
11
+ let b;
12
+ f[2] === Symbol.for("react.memo_cache_sentinel") ? (b = (e) => _(e.target.value), f[2] = b) : b = f[2];
13
+ let x = m || !1, S;
14
+ f[3] !== g || f[4] !== x ? (S = /* @__PURE__ */ jsx(PromptInputBody, { children: /* @__PURE__ */ jsx(PromptInputTextarea, {
15
+ value: g,
16
+ onChange: b,
17
17
  placeholder: "Type your message...",
18
- disabled: S,
18
+ disabled: x,
19
19
  rows: 1,
20
20
  className: "flex-1"
21
- }) }), f[3] = _, f[4] = S, f[5] = C) : C = f[5];
22
- let w;
23
- f[6] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ jsx(Pill, {
21
+ }) }), f[3] = g, f[4] = x, f[5] = S) : S = f[5];
22
+ let C;
23
+ f[6] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(Pill, {
24
24
  size: "16",
25
25
  className: "mr-2"
26
- }), f[6] = w) : w = f[6];
27
- let T;
28
- f[7] === y ? T = f[8] : (T = /* @__PURE__ */ jsxs("div", {
26
+ }), f[6] = C) : C = f[6];
27
+ let w;
28
+ f[7] === v ? w = f[8] : (w = /* @__PURE__ */ jsxs("div", {
29
29
  className: "mr-4 flex items-center",
30
- children: [w, y]
31
- }), f[7] = y, f[8] = T);
32
- let E = h || !1, D;
33
- f[9] === E ? D = f[10] : (D = /* @__PURE__ */ jsx(PromptInputSubmit, { disabled: E }), f[9] = E, f[10] = D);
30
+ children: [C, v]
31
+ }), f[7] = v, f[8] = w);
32
+ let T = m || !1, E;
33
+ f[9] === T ? E = f[10] : (E = /* @__PURE__ */ jsx(PromptInputSubmit, { disabled: T }), f[9] = T, f[10] = E);
34
+ let D;
35
+ f[11] !== w || f[12] !== E ? (D = /* @__PURE__ */ jsxs(PromptInputFooter, { children: [w, E] }), f[11] = w, f[12] = E, f[13] = D) : D = f[13];
34
36
  let O;
35
- f[11] !== T || f[12] !== D ? (O = /* @__PURE__ */ jsxs(PromptInputFooter, { children: [T, D] }), f[11] = T, f[12] = D, f[13] = O) : O = f[13];
36
- let k;
37
- return f[14] !== b || f[15] !== C || f[16] !== O ? (k = /* @__PURE__ */ jsxs(PromptInput, {
38
- onSubmit: b,
39
- children: [C, O]
40
- }), f[14] = b, f[15] = C, f[16] = O, f[17] = k) : k = f[17], k;
37
+ return f[14] !== y || f[15] !== S || f[16] !== D ? (O = /* @__PURE__ */ jsxs(PromptInput, {
38
+ onSubmit: y,
39
+ children: [S, D]
40
+ }), f[14] = y, f[15] = S, f[16] = D, f[17] = O) : O = f[17], O;
41
41
  }
42
42
  var AiPromptInput_default = AiPromptInput;
43
43
  export { AiPromptInput_default as default };
@@ -4,20 +4,20 @@ import React from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Loader2 } from "lucide-react";
6
6
  const ButtonFullWidth = (a) => {
7
- let o = c(11), { transition: s, ui: l, disabled: u, onClick: d, isLoading: f } = a, p = l?.label ?? s, m;
8
- o[0] === l?.props ? m = o[1] : (m = l?.props ?? {}, o[0] = l?.props, o[1] = m);
9
- let h = m, g = l?.variant ?? "default", _ = u || f, v;
10
- o[2] === f ? v = o[3] : (v = f && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), o[2] = f, o[3] = v);
11
- let y;
12
- return o[4] !== d || o[5] !== h || o[6] !== p || o[7] !== _ || o[8] !== v || o[9] !== g ? (y = /* @__PURE__ */ jsxs(Button, {
7
+ let o = c(11), { ui: s, disabled: l, onClick: u, isLoading: d } = a, f = s?.label ?? "Submit", p;
8
+ o[0] === s?.props ? p = o[1] : (p = s?.props ?? {}, o[0] = s?.props, o[1] = p);
9
+ let m = p, h = s?.variant ?? "default", g = l || d, _;
10
+ o[2] === d ? _ = o[3] : (_ = d && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), o[2] = d, o[3] = _);
11
+ let v;
12
+ return o[4] !== u || o[5] !== m || o[6] !== f || o[7] !== g || o[8] !== _ || o[9] !== h ? (v = /* @__PURE__ */ jsxs(Button, {
13
13
  type: "button",
14
- variant: g,
15
- ...h,
16
- disabled: _,
17
- onClick: d,
14
+ variant: h,
15
+ ...m,
16
+ disabled: g,
17
+ onClick: u,
18
18
  size: "lg",
19
19
  className: "w-full font-medium",
20
- children: [v, p]
21
- }), o[4] = d, o[5] = h, o[6] = p, o[7] = _, o[8] = v, o[9] = g, o[10] = y) : y = o[10], y;
20
+ children: [_, f]
21
+ }), o[4] = u, o[5] = m, o[6] = f, o[7] = g, o[8] = _, o[9] = h, o[10] = v) : v = o[10], v;
22
22
  };
23
23
  export { ButtonFullWidth };
@@ -0,0 +1,32 @@
1
+ import { Button } from "../../ui/button.js";
2
+ import { Tooltip, TooltipContent, TooltipTrigger } from "../../ui/tooltip.js";
3
+ import { useWorkbenchLayout } from "../../../features/workbench/providers/WorkbenchLayoutProvider.js";
4
+ import { c } from "react/compiler-runtime";
5
+ import React from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { MonitorPlay } from "lucide-react";
8
+ const SandboxRun = (u) => {
9
+ let d = c(12), { ui: f, disabled: p } = u, { openPreviewWithEnvironment: m, environments: h } = useWorkbenchLayout(), g = f?.slotId, _ = g ? h?.find((e) => e.slotId === g) : void 0, v = !!_, y = _?.envName ? `Open ${_.envName}` : "Open Sandbox", b;
10
+ d[0] !== m || d[1] !== g ? (b = () => {
11
+ g && m(g);
12
+ }, d[0] = m, d[1] = g, d[2] = b) : b = d[2];
13
+ let x = b, S = p || !v, C;
14
+ d[3] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(MonitorPlay, { className: "h-4 w-4" }), d[3] = C) : C = d[3];
15
+ let w;
16
+ d[4] !== x || d[5] !== S ? (w = /* @__PURE__ */ jsx(TooltipTrigger, {
17
+ asChild: !0,
18
+ children: /* @__PURE__ */ jsx(Button, {
19
+ type: "button",
20
+ variant: "default",
21
+ size: "icon",
22
+ disabled: S,
23
+ onClick: x,
24
+ children: C
25
+ })
26
+ }), d[4] = x, d[5] = S, d[6] = w) : w = d[6];
27
+ let T;
28
+ d[7] === y ? T = d[8] : (T = /* @__PURE__ */ jsx(TooltipContent, { children: y }), d[7] = y, d[8] = T);
29
+ let E;
30
+ return d[9] !== w || d[10] !== T ? (E = /* @__PURE__ */ jsxs(Tooltip, { children: [w, T] }), d[9] = w, d[10] = T, d[11] = E) : E = d[11], E;
31
+ };
32
+ export { SandboxRun };
@@ -4,20 +4,20 @@ import React from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Loader2 } from "lucide-react";
6
6
  const SubmitButton = (a) => {
7
- let o = c(10), { transition: s, ui: l, disabled: u, onClick: d, isLoading: f } = a, p = l?.label || s, m;
8
- o[0] === l?.props ? m = o[1] : (m = l?.props || {}, o[0] = l?.props, o[1] = m);
9
- let h = m, g = u || f, _;
10
- o[2] === f ? _ = o[3] : (_ = f && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), o[2] = f, o[3] = _);
11
- let v;
12
- return o[4] !== d || o[5] !== h || o[6] !== p || o[7] !== g || o[8] !== _ ? (v = /* @__PURE__ */ jsxs(Button, {
7
+ let o = c(10), { ui: s, disabled: l, onClick: u, isLoading: d } = a, f = s?.label || "Submit", p;
8
+ o[0] === s?.props ? p = o[1] : (p = s?.props || {}, o[0] = s?.props, o[1] = p);
9
+ let m = p, h = l || d, g;
10
+ o[2] === d ? g = o[3] : (g = d && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), o[2] = d, o[3] = g);
11
+ let _;
12
+ return o[4] !== u || o[5] !== m || o[6] !== f || o[7] !== h || o[8] !== g ? (_ = /* @__PURE__ */ jsxs(Button, {
13
13
  type: "button",
14
14
  variant: "default",
15
- ...h,
16
- disabled: g,
17
- onClick: d,
15
+ ...m,
16
+ disabled: h,
17
+ onClick: u,
18
18
  size: "default",
19
19
  className: "w-48",
20
- children: [_, p]
21
- }), o[4] = d, o[5] = h, o[6] = p, o[7] = g, o[8] = _, o[9] = v) : v = o[9], v;
20
+ children: [g, f]
21
+ }), o[4] = u, o[5] = m, o[6] = f, o[7] = h, o[8] = g, o[9] = _) : _ = o[9], _;
22
22
  };
23
23
  export { SubmitButton };
@@ -1,4 +1,4 @@
1
- import { File, FileCode, FileJson, FileText, Folder, FolderOpen } from "lucide-react";
1
+ import { File, FileCode, FileJson, FileText } from "lucide-react";
2
2
  var EXTENSION_ICON_MAP = {
3
3
  ".ts": FileCode,
4
4
  ".tsx": FileCode,
@@ -33,10 +33,7 @@ var EXTENSION_ICON_MAP = {
33
33
  ".log": FileText,
34
34
  ".env": FileText
35
35
  };
36
- function getFileIcon(c) {
37
- return EXTENSION_ICON_MAP[c.includes(".") ? c.slice(c.lastIndexOf(".")).toLowerCase() : ""] ?? File;
36
+ function getFileIcon(a) {
37
+ return EXTENSION_ICON_MAP[a.includes(".") ? a.slice(a.lastIndexOf(".")).toLowerCase() : ""] ?? File;
38
38
  }
39
- function getFolderIcon(e) {
40
- return e ? FolderOpen : Folder;
41
- }
42
- export { getFileIcon, getFolderIcon };
39
+ export { getFileIcon };
@@ -5,7 +5,7 @@ import { c } from "react/compiler-runtime";
5
5
  import React, { useCallback, useEffect, useRef } from "react";
6
6
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
7
  var OAuthPromptRenderer = ({ pipeline: l, workflow: u, document: m, isActive: h }) => {
8
- let g = m.content, _ = (m.ui?.actions ?? []).find((e) => e.transition)?.transition, v = useRunPipeline(), { result: y, open: b, reset: x } = useOAuthPopup(), S = useRef(!1), C = u.availableTransitions?.map((e) => e.id) ?? [], w = useCallback((e, o) => {
8
+ let g = m.content, _ = (m.ui?.actions ?? []).map((e) => e.options?.transition).find((e) => !!e), v = useRunPipeline(), { result: y, open: b, reset: x } = useOAuthPopup(), S = useRef(!1), C = u.availableTransitions?.map((e) => e.id) ?? [], w = useCallback((e, o) => {
9
9
  !_ || !C.includes(_) || v.mutate({
10
10
  pipelineId: l.id,
11
11
  runPipelinePayloadDto: { transition: {
@@ -0,0 +1,197 @@
1
+ import { useStudio } from "../../providers/StudioProvider.js";
2
+ import { useBatchDeletePipeline, useDeletePipeline, useFilterPipelines } from "../../hooks/usePipelines.js";
3
+ import { useFilterWorkspaces } from "../../hooks/useWorkspaces.js";
4
+ import { Badge } from "../../components/ui/badge.js";
5
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../components/ui/tooltip.js";
6
+ import ListView_default from "../../components/lists/ListView.js";
7
+ import { useDebounce } from "../../hooks/useDebounce.js";
8
+ import { c } from "react/compiler-runtime";
9
+ import { useMemo, useState } from "react";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ var statusColors = {
12
+ completed: "bg-green-50 text-green-900 border-green-200",
13
+ failed: "bg-destructive/10 text-destructive border-destructive/20",
14
+ canceled: "bg-orange-50 text-orange-900 border-orange-200",
15
+ running: "bg-blue-50 text-blue-900 border-blue-200",
16
+ paused: "bg-yellow-50 text-yellow-900 border-yellow-200",
17
+ pending: "bg-muted text-muted-foreground border-border"
18
+ }, Runs_default = (n) => {
19
+ let r = c(50), { defaultFilters: i } = n, a;
20
+ r[0] === i ? a = r[1] : (a = i === void 0 ? {} : i, r[0] = i, r[1] = a);
21
+ let o = a, { router: s } = useStudio(), [l, u] = useState(0), [d, f] = useState(10), [p, m] = useState("createdAt"), [h, g] = useState("DESC"), [_, v] = useState(), [y, b] = useState(o), me = useDebounce(_, 500), x;
22
+ r[2] === y ? x = r[3] : (x = {
23
+ ...y,
24
+ parentId: null
25
+ }, r[2] = y, r[3] = x);
26
+ let S = useFilterPipelines(me, x, p, h, l, d), C;
27
+ r[4] === Symbol.for("react.memo_cache_sentinel") ? (C = {}, r[4] = C) : C = r[4];
28
+ let w = useFilterWorkspaces(void 0, C, "title", "ASC", 0, 100), T = useDeletePipeline(), E = useBatchDeletePipeline(), D;
29
+ if (r[5] !== w.data?.data) {
30
+ D = /* @__PURE__ */ new Map();
31
+ for (let e of w.data?.data ?? []) D.set(e.id, e.title);
32
+ r[5] = w.data?.data, r[6] = D;
33
+ } else D = r[6];
34
+ let O = D, k;
35
+ r[7] === w.data?.data ? k = r[8] : (k = w.data?.data ?? [], r[7] = w.data?.data, r[8] = k);
36
+ let A;
37
+ r[9] === k ? A = r[10] : (A = k.map(_temp), r[9] = k, r[10] = A);
38
+ let j = A, M;
39
+ if (r[11] !== S.data?.data) {
40
+ let e = /* @__PURE__ */ new Set();
41
+ for (let t of S.data?.data ?? []) t.blockName && e.add(t.blockName);
42
+ M = Array.from(e).sort(), r[11] = S.data?.data, r[12] = M;
43
+ } else M = r[12];
44
+ let N = M, P;
45
+ r[13] === T ? P = r[14] : (P = (e) => {
46
+ T.mutate(e);
47
+ }, r[13] = T, r[14] = P);
48
+ let F = P, I;
49
+ r[15] === E ? I = r[16] : (I = (e) => {
50
+ E.mutate(e);
51
+ }, r[15] = E, r[16] = I);
52
+ let L = I, R;
53
+ r[17] === s ? R = r[18] : (R = (e) => {
54
+ s.navigateToPipeline(e);
55
+ }, r[17] = s, r[18] = R);
56
+ let z = R, B = S.error ?? null, V;
57
+ r[19] === S.data?.data ? V = r[20] : (V = S.data?.data ?? [], r[19] = S.data?.data, r[20] = V);
58
+ let H = S.data?.total ?? 0, U;
59
+ r[21] === Symbol.for("react.memo_cache_sentinel") ? (U = {
60
+ id: "run",
61
+ label: "Run",
62
+ minWidth: 60,
63
+ format: _temp2
64
+ }, r[21] = U) : U = r[21];
65
+ let W;
66
+ r[22] === O ? W = r[23] : (W = {
67
+ id: "workspaceId",
68
+ label: "Workspace",
69
+ minWidth: 120,
70
+ format: (e) => {
71
+ let t = e;
72
+ return /* @__PURE__ */ jsx(Badge, {
73
+ variant: "outline",
74
+ className: "hover:bg-primary/10 cursor-pointer",
75
+ onClick: (e) => {
76
+ e.stopPropagation(), b((e) => ({
77
+ ...e,
78
+ workspaceId: t
79
+ }));
80
+ },
81
+ children: O.get(t) ?? t.slice(0, 8)
82
+ });
83
+ }
84
+ }, r[22] = O, r[23] = W);
85
+ let G, K, q, J;
86
+ r[24] === Symbol.for("react.memo_cache_sentinel") ? (G = {
87
+ id: "blockName",
88
+ label: "Type",
89
+ minWidth: 100,
90
+ format: (e) => {
91
+ let t = e;
92
+ return /* @__PURE__ */ jsx(Badge, {
93
+ variant: "outline",
94
+ className: "hover:bg-primary/10 cursor-pointer",
95
+ onClick: (e) => {
96
+ e.stopPropagation(), b((e) => ({
97
+ ...e,
98
+ blockName: t
99
+ }));
100
+ },
101
+ children: t
102
+ });
103
+ }
104
+ }, K = {
105
+ id: "title",
106
+ label: "Title",
107
+ minWidth: 150,
108
+ format: _temp3
109
+ }, q = {
110
+ id: "status",
111
+ label: "Status",
112
+ minWidth: 100,
113
+ format: _temp4
114
+ }, J = {
115
+ id: "createdAt",
116
+ label: "Date Created",
117
+ minWidth: 100,
118
+ format: _temp5
119
+ }, r[24] = G, r[25] = K, r[26] = q, r[27] = J) : (G = r[24], K = r[25], q = r[26], J = r[27]);
120
+ let Y;
121
+ r[28] === W ? Y = r[29] : (Y = [
122
+ U,
123
+ W,
124
+ G,
125
+ K,
126
+ q,
127
+ J
128
+ ], r[28] = W, r[29] = Y);
129
+ let X = Y, Z;
130
+ r[30] === Symbol.for("react.memo_cache_sentinel") ? (Z = [
131
+ "pending",
132
+ "running",
133
+ "paused",
134
+ "completed",
135
+ "failed",
136
+ "canceled"
137
+ ], r[30] = Z) : Z = r[30];
138
+ let Q;
139
+ r[31] !== N || r[32] !== j ? (Q = {
140
+ status: Z,
141
+ workspaceId: j,
142
+ blockName: N
143
+ }, r[31] = N, r[32] = j, r[33] = Q) : Q = r[33];
144
+ let $;
145
+ return r[34] !== S.isPending || r[35] !== y || r[36] !== L || r[37] !== F || r[38] !== z || r[39] !== h || r[40] !== p || r[41] !== l || r[42] !== d || r[43] !== _ || r[44] !== B || r[45] !== V || r[46] !== H || r[47] !== X || r[48] !== Q ? ($ = /* @__PURE__ */ jsx(ListView_default, {
146
+ loading: S.isPending,
147
+ error: B,
148
+ items: V,
149
+ totalItems: H,
150
+ setPage: u,
151
+ setRowsPerPage: f,
152
+ setOrderBy: m,
153
+ setOrder: g,
154
+ setSearchTerm: v,
155
+ setFilters: b,
156
+ orderBy: p,
157
+ order: h,
158
+ searchTerm: _,
159
+ filters: y,
160
+ page: l,
161
+ rowsPerPage: d,
162
+ deleteItem: F,
163
+ onClick: z,
164
+ enableBatchActions: !0,
165
+ batchDelete: L,
166
+ columns: X,
167
+ filterConfig: Q
168
+ }), r[34] = S.isPending, r[35] = y, r[36] = L, r[37] = F, r[38] = z, r[39] = h, r[40] = p, r[41] = l, r[42] = d, r[43] = _, r[44] = B, r[45] = V, r[46] = H, r[47] = X, r[48] = Q, r[49] = $) : $ = r[49], $;
169
+ };
170
+ function _temp(e) {
171
+ return {
172
+ label: e.title,
173
+ value: e.id
174
+ };
175
+ }
176
+ function _temp2(e) {
177
+ let t = e;
178
+ return t == null ? "—" : `#${t}`;
179
+ }
180
+ function _temp3(e) {
181
+ let t = e;
182
+ return t ? /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
183
+ asChild: !0,
184
+ children: /* @__PURE__ */ jsx("span", { children: t.length > 40 ? t.slice(0, 40) + "..." : t })
185
+ }), t.length > 40 && /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: t }) })] }) }) : "—";
186
+ }
187
+ function _temp4(e) {
188
+ let t = e;
189
+ return /* @__PURE__ */ jsx(Badge, {
190
+ className: `rounded-full border px-2 py-1 text-xs whitespace-nowrap ${statusColors[t] || "bg-muted text-muted-foreground border-border"}`,
191
+ children: t
192
+ });
193
+ }
194
+ function _temp5(e) {
195
+ return new Date(e).toLocaleDateString();
196
+ }
197
+ export { Runs_default as default };
@@ -2,7 +2,7 @@ import { useStudio } from "../../providers/StudioProvider.js";
2
2
  import { useFetchWorkflowsByNamespace } from "../../hooks/useWorkflows.js";
3
3
  import { Skeleton } from "../../components/ui/skeleton.js";
4
4
  import { SidebarMenuSubItem } from "../../components/ui/sidebar.js";
5
- import { WorkbenchContextProvider } from "./providers/WorkbenchContextProvider.js";
5
+ import { WorkbenchContextProvider } from "./providers/WorkbenchLayoutProvider.js";
6
6
  import NavigationItem_default from "./components/NavigationItem.js";
7
7
  import { useScroll } from "./providers/ScrollProvider.js";
8
8
  import { c } from "react/compiler-runtime";