@loopstack/loopstack-studio 0.21.2 → 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 (89) 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/input.js +1 -1
  17. package/dist/components/ui/select.js +1 -1
  18. package/dist/components/ui/sidebar.js +359 -359
  19. package/dist/components/ui/textarea.js +1 -1
  20. package/dist/components/ui-widgets/UiActions.js +22 -15
  21. package/dist/components/ui-widgets/UiWidget.js +31 -26
  22. package/dist/components/ui-widgets/widgets/AiPromptInput.js +27 -27
  23. package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +12 -12
  24. package/dist/components/ui-widgets/widgets/SandboxRun.js +32 -0
  25. package/dist/components/ui-widgets/widgets/SubmitButton.js +11 -11
  26. package/dist/features/code-explorer/utils/fileIcons.js +4 -7
  27. package/dist/features/oauth/OAuthPromptRenderer.js +1 -1
  28. package/dist/features/runs/Runs.js +197 -0
  29. package/dist/features/workbench/NavigationItems.js +1 -1
  30. package/dist/features/workbench/Workbench.js +109 -75
  31. package/dist/features/workbench/WorkflowItem.js +8 -11
  32. package/dist/features/workbench/WorkflowList.js +29 -20
  33. package/dist/features/workbench/components/DocumentList.js +20 -20
  34. package/dist/features/workbench/components/NewRunDialog.js +328 -0
  35. package/dist/features/workbench/components/WorkbenchFloatingPanel.js +88 -0
  36. package/dist/features/workbench/components/WorkbenchFlowPanel.js +48 -0
  37. package/dist/features/workbench/components/WorkbenchIconSidebar.js +68 -0
  38. package/dist/features/workbench/components/WorkbenchPreviewPanel.js +128 -0
  39. package/dist/features/workbench/components/WorkflowForms.js +7 -6
  40. package/dist/features/workbench/components/WorkflowHistoryItem.js +68 -63
  41. package/dist/features/workbench/components/buttons/WorkflowButtons.js +79 -61
  42. package/dist/features/workbench/components/document-renderer/DocumentFormRenderer.js +6 -5
  43. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +77 -0
  44. package/dist/features/workspaces/Workspaces.js +2 -2
  45. package/dist/features/workspaces/components/CreateWorkspace.js +164 -81
  46. package/dist/features/workspaces/components/EnvironmentSlotSelector.js +63 -0
  47. package/dist/features/workspaces/components/ExecutionTimeline.js +69 -68
  48. package/dist/features/workspaces/components/PipelineForm.js +4 -4
  49. package/dist/hooks/index.js +2 -0
  50. package/dist/hooks/useApi.js +9 -33
  51. package/dist/hooks/useAuth.js +18 -38
  52. package/dist/hooks/useConfig.js +31 -33
  53. package/dist/hooks/useDashboard.js +1 -4
  54. package/dist/hooks/useDocuments.js +4 -8
  55. package/dist/hooks/useFiles.js +31 -41
  56. package/dist/hooks/useNamespaces.js +5 -8
  57. package/dist/hooks/usePipelines.js +98 -108
  58. package/dist/hooks/useProcessor.js +1 -4
  59. package/dist/hooks/useWorkflows.js +25 -41
  60. package/dist/hooks/useWorkspaces.js +45 -72
  61. package/dist/index.d.ts +266 -48
  62. package/dist/index.js +10 -2
  63. package/dist/packages/contracts/dist/enums/index.js +25 -0
  64. package/dist/packages/contracts/dist/enums/pipeline-state.js +10 -0
  65. package/dist/packages/contracts/dist/enums/registry.enum.js +20 -0
  66. package/dist/packages/contracts/dist/enums/sort-order.enum.js +10 -0
  67. package/dist/packages/contracts/dist/enums/user-type.enum.js +10 -0
  68. package/dist/packages/contracts/dist/enums/workflow-state.enum.js +10 -0
  69. package/dist/pages/DebugPage.js +12 -14
  70. package/dist/pages/DebugWorkflowDetailsPage.js +1 -1
  71. package/dist/pages/DebugWorkflowsPage.js +3 -4
  72. package/dist/pages/EmbedWorkbenchPage.js +4 -3
  73. package/dist/pages/PipelineDebugPage.js +2 -2
  74. package/dist/pages/PreviewWorkbenchPage.js +416 -0
  75. package/dist/pages/RunsListPage.js +36 -0
  76. package/dist/pages/RunsPage.js +49 -0
  77. package/dist/pages/StudioLandingPage.js +145 -0
  78. package/dist/pages/WorkbenchPage.js +75 -51
  79. package/dist/providers/InvalidationEventsProvider.js +7 -7
  80. package/dist/providers/QueryProvider.js +21 -0
  81. package/dist/routing/LocalRouter.js +9 -0
  82. package/dist/services/createApiClient.js +4 -10
  83. package/dist/services/index.js +1 -1
  84. package/package.json +2 -3
  85. package/dist/features/code-explorer/CodeExplorer.js +0 -69
  86. package/dist/features/code-explorer/components/CodeExplorerTree.js +0 -43
  87. package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +0 -82
  88. package/dist/features/workbench/components/WorkbenchSidebar.js +0 -109
  89. package/dist/features/workbench/providers/WorkbenchContextProvider.js +0 -3
@@ -1,20 +1,21 @@
1
+ import { require_enums } from "../../../packages/contracts/dist/enums/index.js";
1
2
  import UiActions_default from "../../../components/ui-widgets/UiActions.js";
2
3
  import { c } from "react/compiler-runtime";
3
4
  import React from "react";
4
- import { WorkflowState } from "@loopstack/api-client";
5
5
  import { jsx } from "react/jsx-runtime";
6
- var WorkflowForms_default = (a) => {
7
- let o = c(7), { workflow: s, onSubmit: l } = a, u = s.ui?.actions;
6
+ var import_enums = require_enums(), WorkflowForms_default = (e) => {
7
+ let o = c(8), { workflow: s, onSubmit: l } = e, u = s.ui?.actions;
8
8
  if (!u?.length) return null;
9
9
  let d;
10
10
  o[0] === s.availableTransitions ? d = o[1] : (d = s.availableTransitions?.map(_temp) ?? [], o[0] = s.availableTransitions, o[1] = d);
11
- let f = d, p = u, m = s.status === WorkflowState.Completed, h;
12
- return o[2] !== f || o[3] !== l || o[4] !== p || o[5] !== m ? (h = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(UiActions_default, {
11
+ let f = d, p = u, m = s.status === import_enums.WorkflowState.Completed, h;
12
+ return o[2] !== f || o[3] !== l || o[4] !== p || o[5] !== m || o[6] !== s.place ? (h = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(UiActions_default, {
13
13
  actions: p,
14
14
  availableTransitions: f,
15
+ currentPlace: s.place,
15
16
  disabled: m,
16
17
  onSubmit: l
17
- }) }), o[2] = f, o[3] = l, o[4] = p, o[5] = m, o[6] = h) : h = o[6], h;
18
+ }) }), o[2] = f, o[3] = l, o[4] = p, o[5] = m, o[6] = s.place, o[7] = h) : h = o[7], h;
18
19
  };
19
20
  function _temp(e) {
20
21
  return e.id;
@@ -2,102 +2,104 @@ import { useWorkflow } from "../../../hooks/useWorkflows.js";
2
2
  import { cn } from "../../../lib/utils.js";
3
3
  import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../../components/ui/collapsible.js";
4
4
  import { Tooltip, TooltipContent, TooltipTrigger } from "../../../components/ui/tooltip.js";
5
- import { SidebarMenuButton, SidebarMenuItem, SidebarMenuSub } from "../../../components/ui/sidebar.js";
6
5
  import { c } from "react/compiler-runtime";
7
6
  import React from "react";
8
7
  import { jsx, jsxs } from "react/jsx-runtime";
9
8
  import { ChevronRight, Clock, Loader2, Play, Wrench } from "lucide-react";
10
9
  import { format } from "date-fns";
11
- var WorkflowHistoryItem_default = (x) => {
12
- let S = c(19), { workflowId: C, workflow: w } = x, T = useWorkflow(C), E = T.data?.history;
13
- if (T.isLoading) {
10
+ var WorkflowHistoryItem_default = (_) => {
11
+ let y = c(19), { workflowId: b, workflow: x } = _, S = useWorkflow(b), C = S.data?.history;
12
+ if (S.isLoading) {
14
13
  let e;
15
- return S[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(SidebarMenuButton, {
16
- className: "opacity-50",
17
- children: [/* @__PURE__ */ jsx(Loader2, { className: "h-3 w-3 animate-spin" }), /* @__PURE__ */ jsx("span", {
18
- className: "text-sm",
19
- children: "Loading..."
20
- })]
21
- }) }), S[0] = e) : e = S[0], e;
14
+ return y[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx("li", {
15
+ className: "group/menu-item relative list-none",
16
+ children: /* @__PURE__ */ jsxs("div", {
17
+ className: "flex w-full items-center gap-2 rounded-md p-2 text-sm opacity-50",
18
+ children: [/* @__PURE__ */ jsx(Loader2, { className: "h-3 w-3 animate-spin" }), /* @__PURE__ */ jsx("span", {
19
+ className: "text-sm",
20
+ children: "Loading..."
21
+ })]
22
+ })
23
+ }), y[0] = e) : e = y[0], e;
22
24
  }
23
- if (!E?.length) return null;
24
- let D;
25
- S[1] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ jsx(Play, { className: "text-primary h-3.5 w-3.5 fill-current" }), S[1] = D) : D = S[1];
26
- let O = w.title ?? w.blockName, k;
27
- S[2] === O ? k = S[3] : (k = /* @__PURE__ */ jsx("span", {
25
+ if (!C?.length) return null;
26
+ let w;
27
+ y[1] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ jsx(Play, { className: "text-primary h-3.5 w-3.5 fill-current" }), y[1] = w) : w = y[1];
28
+ let T = x.title ?? x.blockName, E;
29
+ y[2] === T ? E = y[3] : (E = /* @__PURE__ */ jsx("span", {
28
30
  className: "truncate text-sm",
29
- children: O
30
- }), S[2] = O, S[3] = k);
31
- let A;
32
- S[4] === Symbol.for("react.memo_cache_sentinel") ? (A = /* @__PURE__ */ jsx(ChevronRight, { className: "text-muted-foreground ml-auto h-3.5 w-3.5 transition-transform group-data-[state=open]/collapsible:rotate-90" }), S[4] = A) : A = S[4];
33
- let j;
34
- S[5] === k ? j = S[6] : (j = /* @__PURE__ */ jsx(CollapsibleTrigger, {
31
+ children: T
32
+ }), y[2] = T, y[3] = E);
33
+ let D;
34
+ y[4] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ jsx(ChevronRight, { className: "text-muted-foreground ml-auto h-3.5 w-3.5 transition-transform group-data-[state=open]/collapsible:rotate-90" }), y[4] = D) : D = y[4];
35
+ let O;
36
+ y[5] === E ? O = y[6] : (O = /* @__PURE__ */ jsx(CollapsibleTrigger, {
35
37
  asChild: !0,
36
- children: /* @__PURE__ */ jsxs(SidebarMenuButton, {
37
- className: "group/trigger font-medium",
38
+ children: /* @__PURE__ */ jsxs("button", {
39
+ className: "hover:bg-accent hover:text-accent-foreground group/trigger flex w-full items-center gap-2 rounded-md p-2 text-left text-sm font-medium",
38
40
  children: [
39
- D,
40
- k,
41
- A
41
+ w,
42
+ E,
43
+ D
42
44
  ]
43
45
  })
44
- }), S[5] = k, S[6] = j);
45
- let M;
46
- S[7] === Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ jsx("div", { className: "from-primary/60 via-primary/30 to-muted/20 absolute top-7 bottom-3 left-1.75 w-0.5 rounded-full bg-linear-to-b" }), S[7] = M) : M = S[7];
47
- let N;
48
- S[8] === Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ jsx("div", {
46
+ }), y[5] = E, y[6] = O);
47
+ let k;
48
+ y[7] === Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ jsx("div", { className: "from-primary/60 via-primary/30 to-muted/20 absolute top-7 bottom-3 left-1.75 w-0.5 rounded-full bg-linear-to-b" }), y[7] = k) : k = y[7];
49
+ let A;
50
+ y[8] === Symbol.for("react.memo_cache_sentinel") ? (A = /* @__PURE__ */ jsx("div", {
49
51
  className: "relative z-10 flex shrink-0 items-center justify-center",
50
52
  children: /* @__PURE__ */ jsx("div", { className: "border-primary/60 bg-primary/20 flex h-4 w-4 items-center justify-center rounded-full border-2" })
51
- }), S[8] = N) : N = S[8];
52
- let P;
53
- S[9] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ jsxs("div", {
53
+ }), y[8] = A) : A = y[8];
54
+ let j;
55
+ y[9] === Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ jsxs("div", {
54
56
  className: "group/entry relative flex gap-3 py-1 pl-0",
55
- children: [N, /* @__PURE__ */ jsx("div", {
57
+ children: [A, /* @__PURE__ */ jsx("div", {
56
58
  className: "flex min-w-0 flex-1 items-center gap-1.5",
57
59
  children: /* @__PURE__ */ jsx("span", {
58
60
  className: "bg-muted text-foreground w-fit truncate rounded px-1.5 py-0.5 font-mono text-xs font-medium",
59
61
  children: "start"
60
62
  })
61
63
  })]
62
- }), S[9] = P) : P = S[9];
63
- let F;
64
- if (S[10] !== E) {
64
+ }), y[9] = j) : j = y[9];
65
+ let M;
66
+ if (y[10] !== C) {
65
67
  let e;
66
- S[12] === E.length ? e = S[13] : (e = (e, h) => {
68
+ y[12] === C.length ? e = y[13] : (e = (e, p) => {
67
69
  console.log(e);
68
- let g = e.data?.transition, _ = Object.keys(e.data?.tools ?? {}), v = h === E.length - 1, y = e.data?.place ?? g?.to ?? "unknown", b = g?.id;
70
+ let m = e.data?.transition, h = Object.keys(e.data?.tools ?? {}), g = p === C.length - 1, _ = e.data?.place ?? m?.to ?? "unknown", v = m?.id;
69
71
  return /* @__PURE__ */ jsxs("div", {
70
72
  className: "group/entry relative flex gap-3 py-1 pl-0",
71
73
  children: [/* @__PURE__ */ jsx("div", {
72
74
  className: "relative z-10 flex shrink-0 items-center justify-center",
73
75
  children: /* @__PURE__ */ jsx("div", {
74
- className: cn("flex h-4 w-4 items-center justify-center rounded-full border-2 transition-all", v ? "border-primary bg-primary shadow-primary/40 shadow-sm" : "border-muted-foreground/30 bg-background"),
75
- children: v && /* @__PURE__ */ jsx("div", { className: "bg-primary-foreground h-1.5 w-1.5 animate-pulse rounded-full" })
76
+ className: cn("flex h-4 w-4 items-center justify-center rounded-full border-2 transition-all", g ? "border-primary bg-primary shadow-primary/40 shadow-sm" : "border-muted-foreground/30 bg-background"),
77
+ children: g && /* @__PURE__ */ jsx("div", { className: "bg-primary-foreground h-1.5 w-1.5 animate-pulse rounded-full" })
76
78
  })
77
79
  }), /* @__PURE__ */ jsxs("div", {
78
80
  className: "flex min-w-0 flex-1 flex-col gap-0.5",
79
81
  children: [/* @__PURE__ */ jsxs("div", {
80
82
  className: "flex items-baseline gap-1.5",
81
83
  children: [/* @__PURE__ */ jsx("span", {
82
- className: cn("w-fit truncate rounded px-1.5 py-0.5 font-mono text-xs font-medium", v ? "bg-primary/15 text-primary" : "bg-muted/60 text-muted-foreground"),
83
- children: y
84
- }), b && /* @__PURE__ */ jsxs("span", {
84
+ className: cn("w-fit truncate rounded px-1.5 py-0.5 font-mono text-xs font-medium", g ? "bg-primary/15 text-primary" : "bg-muted/60 text-muted-foreground"),
85
+ children: _
86
+ }), v && /* @__PURE__ */ jsxs("span", {
85
87
  className: "text-muted-foreground truncate text-[10px] italic",
86
88
  children: [
87
89
  "(via ",
88
- b,
90
+ v,
89
91
  ")"
90
92
  ]
91
93
  })]
92
94
  }), /* @__PURE__ */ jsxs("div", {
93
95
  className: "text-muted-foreground flex items-center gap-2 text-[10px]",
94
- children: [_.length > 0 && /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
96
+ children: [h.length > 0 && /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
95
97
  asChild: !0,
96
98
  children: /* @__PURE__ */ jsxs("div", {
97
99
  className: "flex cursor-default items-center gap-0.5",
98
100
  children: [/* @__PURE__ */ jsx(Wrench, { className: "h-3 w-3" }), /* @__PURE__ */ jsx("span", {
99
101
  className: "tabular-nums",
100
- children: _.length
102
+ children: h.length
101
103
  })]
102
104
  })
103
105
  }), /* @__PURE__ */ jsxs(TooltipContent, {
@@ -108,7 +110,7 @@ var WorkflowHistoryItem_default = (x) => {
108
110
  children: "Tools used:"
109
111
  }), /* @__PURE__ */ jsx("p", {
110
112
  className: "text-muted-foreground text-[11px]",
111
- children: _.join(", ")
113
+ children: h.join(", ")
112
114
  })]
113
115
  })] }), /* @__PURE__ */ jsxs("div", {
114
116
  className: "flex items-center gap-0.5",
@@ -120,25 +122,28 @@ var WorkflowHistoryItem_default = (x) => {
120
122
  })]
121
123
  })]
122
124
  }, e.version);
123
- }, S[12] = E.length, S[13] = e), F = E.map(e), S[10] = E, S[11] = F;
124
- } else F = S[11];
125
- let I;
126
- S[14] === F ? I = S[15] : (I = /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx(SidebarMenuSub, {
127
- className: "ml-2 border-none pl-0",
125
+ }, y[12] = C.length, y[13] = e), M = C.map(e), y[10] = C, y[11] = M;
126
+ } else M = y[11];
127
+ let N;
128
+ y[14] === M ? N = y[15] : (N = /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("ul", {
129
+ className: "ml-2 flex min-w-0 flex-col gap-1 pl-0",
128
130
  children: /* @__PURE__ */ jsxs("div", {
129
131
  className: "relative py-2",
130
132
  children: [
131
- M,
132
- P,
133
- F
133
+ k,
134
+ j,
135
+ M
134
136
  ]
135
137
  })
136
- }) }), S[14] = F, S[15] = I);
137
- let L;
138
- return S[16] !== I || S[17] !== j ? (L = /* @__PURE__ */ jsx(Collapsible, {
138
+ }) }), y[14] = M, y[15] = N);
139
+ let P;
140
+ return y[16] !== N || y[17] !== O ? (P = /* @__PURE__ */ jsx(Collapsible, {
139
141
  defaultOpen: !0,
140
142
  className: "group/collapsible",
141
- children: /* @__PURE__ */ jsxs(SidebarMenuItem, { children: [j, I] })
142
- }), S[16] = I, S[17] = j, S[18] = L) : L = S[18], L;
143
+ children: /* @__PURE__ */ jsxs("li", {
144
+ className: "group/menu-item relative list-none",
145
+ children: [O, N]
146
+ })
147
+ }), y[16] = N, y[17] = O, y[18] = P) : P = y[18], P;
143
148
  };
144
149
  export { WorkflowHistoryItem_default as default };
@@ -1,85 +1,103 @@
1
1
  import { useStudio } from "../../../../providers/StudioProvider.js";
2
- import { useDeleteWorkflow } from "../../../../hooks/useWorkflows.js";
2
+ import { useDeleteWorkflow, useWorkflow } from "../../../../hooks/useWorkflows.js";
3
3
  import { Button } from "../../../../components/ui/button.js";
4
4
  import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "../../../../components/ui/alert-dialog.js";
5
+ import { Tooltip, TooltipContent, TooltipTrigger } from "../../../../components/ui/tooltip.js";
5
6
  import { useRunPipeline } from "../../../../hooks/useProcessor.js";
6
7
  import { c } from "react/compiler-runtime";
7
8
  import React from "react";
8
9
  import { jsx, jsxs } from "react/jsx-runtime";
9
- import { LockOpen, Trash2 } from "lucide-react";
10
- var WorkflowButtons_default = (b) => {
11
- let x = c(33), { pipeline: S, workflow: C } = b, { router: w } = useStudio(), T = useDeleteWorkflow(), E = useRunPipeline(), D;
12
- x[0] !== S.id || x[1] !== E ? (D = () => {
13
- E.mutate({
14
- pipelineId: S.id,
10
+ import { LockOpen, Repeat } from "lucide-react";
11
+ var WorkflowButtons_default = (T) => {
12
+ let E = c(36), { pipeline: D, workflowId: O } = T, { router: k } = useStudio(), A = useWorkflow(O).data, j = useDeleteWorkflow(), M = useRunPipeline(), N;
13
+ E[0] !== D.id || E[1] !== M ? (N = () => {
14
+ M.mutate({
15
+ pipelineId: D.id,
15
16
  runPipelinePayloadDto: {},
16
17
  force: !1
17
18
  });
18
- }, x[0] = S.id, x[1] = E, x[2] = D) : D = x[2];
19
- let O = D, k;
20
- x[3] !== S.id || x[4] !== E || x[5] !== C.id ? (k = () => {
21
- E.mutate({
22
- pipelineId: S.id,
19
+ }, E[0] = D.id, E[1] = M, E[2] = N) : N = E[2];
20
+ let P = N, F;
21
+ E[3] !== D.id || E[4] !== M || E[5] !== O ? (F = () => {
22
+ M.mutate({
23
+ pipelineId: D.id,
23
24
  runPipelinePayloadDto: { transition: {
24
25
  name: "unlock",
25
- workflowId: C.id
26
+ workflowId: O
26
27
  } },
27
28
  force: !1
28
29
  });
29
- }, x[3] = S.id, x[4] = E, x[5] = C.id, x[6] = k) : k = x[6];
30
- let A = k, j;
31
- x[7] !== T || x[8] !== O || x[9] !== S.id || x[10] !== w || x[11] !== C ? (j = () => {
32
- try {
33
- T.mutate(C), O(), w.navigateToPipeline(S.id);
34
- } catch (e) {
35
- let y = e;
36
- console.error("Mutation failed:", y);
30
+ }, E[3] = D.id, E[4] = M, E[5] = O, E[6] = F) : F = E[6];
31
+ let I = F, L;
32
+ E[7] !== j || E[8] !== P || E[9] !== D.id || E[10] !== k || E[11] !== A ? (L = () => {
33
+ if (A) try {
34
+ j.mutate(A), P(), k.navigateToPipeline(D.id);
35
+ } catch (t) {
36
+ let w = t;
37
+ console.error("Mutation failed:", w);
37
38
  }
38
- }, x[7] = T, x[8] = O, x[9] = S.id, x[10] = w, x[11] = C, x[12] = j) : j = x[12];
39
- let M = j, N;
40
- x[13] === T.isPending ? N = x[14] : (N = T.isPending ? /* @__PURE__ */ jsx("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }) : /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4" }), x[13] = T.isPending, x[14] = N);
41
- let P;
42
- x[15] !== T.isPending || x[16] !== N ? (P = /* @__PURE__ */ jsx(AlertDialogTrigger, {
39
+ }, E[7] = j, E[8] = P, E[9] = D.id, E[10] = k, E[11] = A, E[12] = L) : L = E[12];
40
+ let R = L;
41
+ if (!A) return null;
42
+ let z;
43
+ E[13] === j.isPending ? z = E[14] : (z = j.isPending ? /* @__PURE__ */ jsx("div", { className: "h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }) : /* @__PURE__ */ jsx(Repeat, { className: "h-3.5 w-3.5" }), E[13] = j.isPending, E[14] = z);
44
+ let B;
45
+ E[15] !== j.isPending || E[16] !== z ? (B = /* @__PURE__ */ jsx(TooltipTrigger, {
43
46
  asChild: !0,
44
- children: /* @__PURE__ */ jsxs(Button, {
45
- variant: "ghost",
46
- size: "sm",
47
- disabled: T.isPending,
48
- children: [N, "Delete and Repeat Workflow"]
47
+ children: /* @__PURE__ */ jsx(AlertDialogTrigger, {
48
+ asChild: !0,
49
+ children: /* @__PURE__ */ jsx(Button, {
50
+ variant: "ghost",
51
+ size: "icon",
52
+ className: "h-7 w-7",
53
+ disabled: j.isPending,
54
+ children: z
55
+ })
49
56
  })
50
- }), x[15] = T.isPending, x[16] = N, x[17] = P) : P = x[17];
51
- let F;
52
- x[18] === Symbol.for("react.memo_cache_sentinel") ? (F = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "Are you sure?" }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: "This action cannot be undone. This will permanently delete the workflow." })] }), x[18] = F) : F = x[18];
53
- let I;
54
- x[19] === Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ jsx(AlertDialogCancel, { children: "Cancel" }), x[19] = I) : I = x[19];
55
- let L;
56
- x[20] === M ? L = x[21] : (L = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [F, /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [I, /* @__PURE__ */ jsx(AlertDialogAction, {
57
- className: "bg-destructive hover:bg-destructive/90 text-white",
58
- onClick: M,
59
- children: "Delete"
60
- })] })] }), x[20] = M, x[21] = L);
61
- let R;
62
- x[22] !== P || x[23] !== L ? (R = /* @__PURE__ */ jsxs(AlertDialog, { children: [P, L] }), x[22] = P, x[23] = L, x[24] = R) : R = x[24];
63
- let z;
64
- x[25] !== A || x[26] !== E.isPending || x[27] !== C.availableTransitions || x[28] !== C.place ? (z = C.place === "end" && C.availableTransitions?.find(_temp) && /* @__PURE__ */ jsxs(AlertDialog, { children: [/* @__PURE__ */ jsx(AlertDialogTrigger, {
57
+ }), E[15] = j.isPending, E[16] = z, E[17] = B) : B = E[17];
58
+ let V;
59
+ E[18] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ jsx(TooltipContent, { children: "Repeat" }), E[18] = V) : V = E[18];
60
+ let H;
61
+ E[19] === B ? H = E[20] : (H = /* @__PURE__ */ jsxs(Tooltip, { children: [B, V] }), E[19] = B, E[20] = H);
62
+ let U;
63
+ E[21] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "Repeat workflow" }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: "This will delete the current workflow run and re-trigger the pipeline." })] }), E[21] = U) : U = E[21];
64
+ let W;
65
+ E[22] === Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ jsx(AlertDialogCancel, { children: "Cancel" }), E[22] = W) : W = E[22];
66
+ let G;
67
+ E[23] === R ? G = E[24] : (G = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [U, /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [W, /* @__PURE__ */ jsx(AlertDialogAction, {
68
+ onClick: R,
69
+ children: "Repeat"
70
+ })] })] }), E[23] = R, E[24] = G);
71
+ let K;
72
+ E[25] !== G || E[26] !== H ? (K = /* @__PURE__ */ jsxs(AlertDialog, { children: [H, G] }), E[25] = G, E[26] = H, E[27] = K) : K = E[27];
73
+ let q;
74
+ E[28] !== I || E[29] !== M.isPending || E[30] !== A.availableTransitions || E[31] !== A.place ? (q = A.place === "end" && A.availableTransitions?.find(_temp2) && /* @__PURE__ */ jsxs(AlertDialog, { children: [/* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
65
75
  asChild: !0,
66
- children: /* @__PURE__ */ jsxs(Button, {
67
- variant: "ghost",
68
- size: "sm",
69
- disabled: E.isPending,
70
- children: [E.isPending ? /* @__PURE__ */ jsx("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }) : /* @__PURE__ */ jsx(LockOpen, { className: "h-4 w-4" }), "Unlock Step"]
76
+ children: /* @__PURE__ */ jsx(AlertDialogTrigger, {
77
+ asChild: !0,
78
+ children: /* @__PURE__ */ jsx(Button, {
79
+ variant: "ghost",
80
+ size: "icon",
81
+ className: "h-7 w-7",
82
+ disabled: M.isPending,
83
+ children: M.isPending ? /* @__PURE__ */ jsx("div", { className: "h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent" }) : /* @__PURE__ */ jsx(LockOpen, { className: "h-3.5 w-3.5" })
84
+ })
71
85
  })
72
- }), /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "Unlock workflow" }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: "Are you sure you want to unlock this workflow?" })] }), /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogCancel, { children: "Cancel" }), /* @__PURE__ */ jsx(AlertDialogAction, {
73
- onClick: A,
86
+ }), /* @__PURE__ */ jsx(TooltipContent, { children: "Unlock Step" })] }), /* @__PURE__ */ jsxs(AlertDialogContent, { children: [/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: "Unlock workflow" }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: "Are you sure you want to unlock this workflow?" })] }), /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogCancel, { children: "Cancel" }), /* @__PURE__ */ jsx(AlertDialogAction, {
87
+ onClick: I,
74
88
  children: "Unlock"
75
- })] })] })] }), x[25] = A, x[26] = E.isPending, x[27] = C.availableTransitions, x[28] = C.place, x[29] = z) : z = x[29];
76
- let B;
77
- return x[30] !== z || x[31] !== R ? (B = /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", {
78
- className: "flex",
79
- children: [R, z]
80
- }) }), x[30] = z, x[31] = R, x[32] = B) : B = x[32], B;
89
+ })] })] })] }), E[28] = I, E[29] = M.isPending, E[30] = A.availableTransitions, E[31] = A.place, E[32] = q) : q = E[32];
90
+ let J;
91
+ return E[33] !== K || E[34] !== q ? (J = /* @__PURE__ */ jsxs("div", {
92
+ className: "flex items-center",
93
+ onClick: _temp,
94
+ children: [K, q]
95
+ }), E[33] = K, E[34] = q, E[35] = J) : J = E[35], J;
81
96
  };
82
- function _temp(e) {
83
- return e.id === "unlock";
97
+ function _temp(t) {
98
+ return t.stopPropagation();
99
+ }
100
+ function _temp2(t) {
101
+ return t.id === "unlock";
84
102
  }
85
103
  export { WorkflowButtons_default as default };
@@ -7,7 +7,7 @@ import { jsx } from "react/jsx-runtime";
7
7
  import { useForm } from "react-hook-form";
8
8
  import "zod";
9
9
  var DocumentFormRenderer_default = (l) => {
10
- let u = c(38), { pipeline: d, workflow: f, document: p, enabled: m, viewOnly: h } = l, g = useRunPipeline(), _;
10
+ let u = c(39), { pipeline: d, workflow: f, document: p, enabled: m, viewOnly: h } = l, g = useRunPipeline(), _;
11
11
  u[0] !== p.content || u[1] !== p.schema.type ? (_ = p.schema.type === "object" ? p.content : { raw: p.content }, u[0] = p.content, u[1] = p.schema.type, u[2] = _) : _ = u[2];
12
12
  let v;
13
13
  u[3] === _ ? v = u[4] : (v = {
@@ -52,15 +52,16 @@ var DocumentFormRenderer_default = (l) => {
52
52
  let k = O, A = p.ui, j = p.schema, M = A?.form?.disabled, N = !m || M || !1, P;
53
53
  u[22] === p.ui?.actions ? P = u[23] : (P = p.ui?.actions ?? [], u[22] = p.ui?.actions, u[23] = P);
54
54
  let F = P, I = A ?? void 0, L = p.meta?.mimeType, R;
55
- u[24] !== F || u[25] !== C || u[26] !== N || u[27] !== k || u[28] !== g.isPending ? (R = /* @__PURE__ */ jsx(UiActions_default, {
55
+ u[24] !== F || u[25] !== C || u[26] !== N || u[27] !== k || u[28] !== g.isPending || u[29] !== f.place ? (R = /* @__PURE__ */ jsx(UiActions_default, {
56
56
  actions: F,
57
57
  onSubmit: k,
58
58
  availableTransitions: C,
59
+ currentPlace: f.place,
59
60
  disabled: N,
60
61
  isLoading: g.isPending
61
- }), u[24] = F, u[25] = C, u[26] = N, u[27] = k, u[28] = g.isPending, u[29] = R) : R = u[29];
62
+ }), u[24] = F, u[25] = C, u[26] = N, u[27] = k, u[28] = g.isPending, u[29] = f.place, u[30] = R) : R = u[30];
62
63
  let z;
63
- return u[30] !== N || u[31] !== y || u[32] !== j || u[33] !== I || u[34] !== L || u[35] !== R || u[36] !== h ? (z = /* @__PURE__ */ jsx("div", {
64
+ return u[31] !== N || u[32] !== y || u[33] !== j || u[34] !== I || u[35] !== L || u[36] !== R || u[37] !== h ? (z = /* @__PURE__ */ jsx("div", {
64
65
  className: "flex",
65
66
  children: /* @__PURE__ */ jsx(Form_default, {
66
67
  form: y,
@@ -71,7 +72,7 @@ var DocumentFormRenderer_default = (l) => {
71
72
  viewOnly: h,
72
73
  actions: R
73
74
  })
74
- }), u[30] = N, u[31] = y, u[32] = j, u[33] = I, u[34] = L, u[35] = R, u[36] = h, u[37] = z) : z = u[37], z;
75
+ }), u[31] = N, u[32] = y, u[33] = j, u[34] = I, u[35] = L, u[36] = R, u[37] = h, u[38] = z) : z = u[38], z;
75
76
  };
76
77
  function _temp(e) {
77
78
  return e.id;
@@ -0,0 +1,77 @@
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 WorkbenchLayoutContext = createContext(null);
5
+ function WorkbenchLayoutProvider(a) {
6
+ let o = c(39), { children: s, pipeline: 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 = k !== null, P;
9
+ o[2] !== O || o[3] !== g ? (P = (t) => {
10
+ O && g?.(t !== null), x(t);
11
+ }, o[2] = O, o[3] = g, o[4] = P) : P = o[4];
12
+ let F = P, I;
13
+ o[5] === F ? I = o[6] : (I = (t) => {
14
+ y((a) => a === t ? null : t), F(null);
15
+ }, o[5] = F, o[6] = I);
16
+ let L = I, R;
17
+ o[7] === Symbol.for("react.memo_cache_sentinel") ? (R = () => {
18
+ y(null);
19
+ }, o[7] = R) : R = o[7];
20
+ let z = R, B;
21
+ o[8] !== k || o[9] !== F ? (B = (t) => {
22
+ let a = k === t ? null : t;
23
+ F(a), a && y(null);
24
+ }, o[8] = k, o[9] = F, o[10] = B) : B = o[10];
25
+ let V = B, H;
26
+ o[11] === F ? H = o[12] : (H = () => {
27
+ F(null);
28
+ }, o[11] = F, o[12] = H);
29
+ let U = H, W;
30
+ o[13] === F ? W = o[14] : (W = (t) => {
31
+ D(t), F("preview"), y(null);
32
+ }, o[13] = F, o[14] = W);
33
+ let G = W, K;
34
+ o[15] === V ? K = o[16] : (K = () => {
35
+ V("preview");
36
+ }, o[15] = V, o[16] = K);
37
+ let q = K, J;
38
+ o[17] !== v || o[18] !== S || o[19] !== w || o[20] !== k || o[21] !== U || o[22] !== m || o[23] !== p || o[24] !== f || o[25] !== _ || o[26] !== G || o[27] !== l || o[28] !== M || o[29] !== N || o[30] !== E || o[31] !== L || o[32] !== q || o[33] !== V || o[34] !== d ? (J = {
39
+ pipeline: l,
40
+ previewPanelEnabled: M,
41
+ isDeveloperMode: _,
42
+ workspaceConfig: d,
43
+ getPreviewUrl: f,
44
+ getEnvironmentPreviewUrl: p,
45
+ environments: m,
46
+ activeFloatingPanel: v,
47
+ toggleFloatingPanel: L,
48
+ closeFloatingPanel: z,
49
+ activeSidePanel: k,
50
+ toggleSidePanel: V,
51
+ closeSidePanel: U,
52
+ selectedSlotId: E,
53
+ setSelectedSlotId: D,
54
+ openPreviewWithEnvironment: G,
55
+ previewPanelOpen: N,
56
+ togglePreviewPanel: q,
57
+ activePreviewTab: S,
58
+ setActivePreviewTab: C,
59
+ activeSectionId: w,
60
+ setActiveSectionId: T
61
+ }, o[17] = v, o[18] = S, o[19] = w, o[20] = k, o[21] = U, o[22] = m, o[23] = p, o[24] = f, o[25] = _, o[26] = G, o[27] = l, o[28] = M, o[29] = N, o[30] = E, o[31] = L, o[32] = q, o[33] = V, o[34] = d, o[35] = J) : J = o[35];
62
+ let Y = J, X;
63
+ return o[36] !== s || o[37] !== Y ? (X = /* @__PURE__ */ jsx(WorkbenchLayoutContext.Provider, {
64
+ value: Y,
65
+ children: s
66
+ }), o[36] = s, o[37] = Y, o[38] = X) : X = o[38], X;
67
+ }
68
+ function _temp(t) {
69
+ return !!t.connectionUrl && !!t.workerId;
70
+ }
71
+ function useWorkbenchLayout() {
72
+ let t = useContext(WorkbenchLayoutContext);
73
+ if (!t) throw Error("useWorkbenchLayout must be used within a WorkbenchLayoutProvider");
74
+ return t;
75
+ }
76
+ const WorkbenchContextProvider = createContext(null);
77
+ export { WorkbenchContextProvider, WorkbenchLayoutProvider, useWorkbenchLayout };
@@ -1,11 +1,11 @@
1
1
  import { useStudio } from "../../providers/StudioProvider.js";
2
+ import { useWorkspaceConfig } from "../../hooks/useConfig.js";
2
3
  import { useBatchDeleteWorkspaces, useDeleteWorkspace, useFilterWorkspaces, useSetFavouriteWorkspace } from "../../hooks/useWorkspaces.js";
3
4
  import { useComponentOverrides } from "../../providers/ComponentOverridesProvider.js";
4
5
  import { Badge } from "../../components/ui/badge.js";
5
6
  import { Dialog, DialogContent } from "../../components/ui/dialog.js";
6
7
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../components/ui/tooltip.js";
7
8
  import ListView_default from "../../components/lists/ListView.js";
8
- import { useWorkspaceConfig } from "../../hooks/useConfig.js";
9
9
  import { useDebounce } from "../../hooks/useDebounce.js";
10
10
  import CreateWorkspace_default from "./components/CreateWorkspace.js";
11
11
  import { c } from "react/compiler-runtime";
@@ -200,7 +200,7 @@ function _temp(e) {
200
200
  function _temp2(e) {
201
201
  return /* @__PURE__ */ jsxs(Badge, {
202
202
  variant: "secondary",
203
- children: [e.providerAppName ?? e.remoteEnvironmentId.slice(0, 8), e.type && /* @__PURE__ */ jsxs("span", {
203
+ children: [e.envName ?? e.remoteEnvironmentId.slice(0, 8), e.type && /* @__PURE__ */ jsxs("span", {
204
204
  className: "text-muted-foreground ml-1",
205
205
  children: [
206
206
  "(",