@loopstack/loopstack-studio 0.21.1 → 0.21.3

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 (37) hide show
  1. package/dist/components/ui/input.js +1 -1
  2. package/dist/components/ui/select.js +2 -2
  3. package/dist/components/ui/textarea.js +1 -1
  4. package/dist/events/sse-client-events.js +7 -0
  5. package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +5 -5
  6. package/dist/features/health/LocalHealthCheck.js +80 -67
  7. package/dist/features/workbench/NavigationItems.js +1 -1
  8. package/dist/features/workbench/WorkflowItem.js +2 -2
  9. package/dist/features/workbench/WorkflowList.js +12 -12
  10. package/dist/features/workbench/components/WorkflowHistoryItem.js +11 -11
  11. package/dist/features/workbench/components/buttons/WorkflowButtons.js +1 -1
  12. package/dist/features/workspaces/Workspaces.js +90 -90
  13. package/dist/hooks/useAuth.js +25 -4
  14. package/dist/hooks/useDocuments.js +1 -1
  15. package/dist/hooks/useNamespaces.js +1 -1
  16. package/dist/hooks/useWorkflows.js +1 -1
  17. package/dist/index.d.ts +13 -1
  18. package/dist/index.js +3 -1
  19. package/dist/node_modules/lodash/_Symbol.js +7 -0
  20. package/dist/node_modules/lodash/_baseGetTag.js +13 -0
  21. package/dist/node_modules/lodash/_baseTrim.js +11 -0
  22. package/dist/node_modules/lodash/_freeGlobal.js +6 -0
  23. package/dist/node_modules/lodash/_getRawTag.js +17 -0
  24. package/dist/node_modules/lodash/_objectToString.js +10 -0
  25. package/dist/node_modules/lodash/_root.js +8 -0
  26. package/dist/node_modules/lodash/_trimmedEndIndex.js +11 -0
  27. package/dist/node_modules/lodash/debounce.js +53 -0
  28. package/dist/node_modules/lodash/isObject.js +10 -0
  29. package/dist/node_modules/lodash/isObjectLike.js +9 -0
  30. package/dist/node_modules/lodash/isSymbol.js +12 -0
  31. package/dist/node_modules/lodash/now.js +10 -0
  32. package/dist/node_modules/lodash/toNumber.js +22 -0
  33. package/dist/pages/EmbedWorkbenchPage.js +1 -1
  34. package/dist/pages/PipelineDebugPage.js +1 -1
  35. package/dist/providers/InvalidationEventsProvider.js +43 -0
  36. package/dist/providers/SseProvider.js +44 -0
  37. package/package.json +2 -2
@@ -6,7 +6,7 @@ function Input(r) {
6
6
  let i = c(10), a, o, s;
7
7
  i[0] === r ? (a = i[1], o = i[2], s = i[3]) : ({className: a, type: s, ...o} = r, i[0] = r, i[1] = a, i[2] = o, i[3] = s);
8
8
  let l;
9
- i[4] === a ? l = i[5] : (l = cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", a), i[4] = a, i[5] = l);
9
+ i[4] === a ? l = i[5] : (l = cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-background px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", a), i[4] = a, i[5] = l);
10
10
  let u;
11
11
  return i[6] !== o || i[7] !== l || i[8] !== s ? (u = /* @__PURE__ */ jsx("input", {
12
12
  type: s,
@@ -36,7 +36,7 @@ function SelectTrigger(s) {
36
36
  let u = c(13), d, f, p, m;
37
37
  u[0] === s ? (d = u[1], f = u[2], p = u[3], m = u[4]) : ({className: f, size: m, children: d, ...p} = s, u[0] = s, u[1] = d, u[2] = f, u[3] = p, u[4] = m);
38
38
  let h = m === void 0 ? "default" : m, g;
39
- u[5] === f ? g = u[6] : (g = cn("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", f), u[5] = f, u[6] = g);
39
+ u[5] === f ? g = u[6] : (g = cn("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit cursor-pointer items-center justify-between gap-2 rounded-md border bg-background px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", f), u[5] = f, u[6] = g);
40
40
  let _;
41
41
  u[7] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ jsx(SelectPrimitive.Icon, {
42
42
  asChild: !0,
@@ -97,7 +97,7 @@ function SelectItem(l) {
97
97
  let u = c(13), d, f, p;
98
98
  u[0] === l ? (d = u[1], f = u[2], p = u[3]) : ({className: f, children: d, ...p} = l, u[0] = l, u[1] = d, u[2] = f, u[3] = p);
99
99
  let m;
100
- u[4] === f ? m = u[5] : (m = cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", f), u[4] = f, u[5] = m);
100
+ u[4] === f ? m = u[5] : (m = cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", f), u[4] = f, u[5] = m);
101
101
  let h;
102
102
  u[6] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ jsx("span", {
103
103
  className: "absolute right-2 flex size-3.5 items-center justify-center",
@@ -6,7 +6,7 @@ function Textarea(r) {
6
6
  let i = c(8), a, o;
7
7
  i[0] === r ? (a = i[1], o = i[2]) : ({className: a, ...o} = r, i[0] = r, i[1] = a, i[2] = o);
8
8
  let s;
9
- i[3] === a ? s = i[4] : (s = cn("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", a), i[3] = a, i[4] = s);
9
+ i[3] === a ? s = i[4] : (s = cn("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-background px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", a), i[3] = a, i[4] = s);
10
10
  let l;
11
11
  return i[5] !== o || i[6] !== s ? (l = /* @__PURE__ */ jsx("textarea", {
12
12
  "data-slot": "textarea",
@@ -0,0 +1,7 @@
1
+ const SseClientEvents = {
2
+ WORKFLOW_CREATED: "workflow.created",
3
+ WORKFLOW_UPDATED: "workflow.updated",
4
+ DOCUMENT_CREATED: "document.created",
5
+ SSE_CONNECTED: "sse.connected"
6
+ };
7
+ export { SseClientEvents };
@@ -1,5 +1,5 @@
1
- import { buildWorkflowGraph, getTransitions } from "../../lib/flow-utils.js";
2
1
  import { useWorkflow } from "../../../../hooks/useWorkflows.js";
2
+ import { buildWorkflowGraph, getTransitions } from "../../lib/flow-utils.js";
3
3
  import { c } from "react/compiler-runtime";
4
4
  import React, { useEffect, useRef } from "react";
5
5
  function countTransitions(e) {
@@ -16,17 +16,17 @@ var WorkflowGraph_default = (s) => {
16
16
  ], l[0] = h.isLoading, l[1] = m, l[2] = d.id, l[3] = v, l[4] = y) : (v = l[3], y = l[4]), useEffect(v, y);
17
17
  let b;
18
18
  l[5] !== p || l[6] !== u || l[7] !== f || l[8] !== d.id || l[9] !== g ? (b = () => {
19
- let a = f ? getTransitions(f) : [], o = JSON.stringify({
19
+ let e = f ? getTransitions(f) : [], o = JSON.stringify({
20
20
  p: countTransitions(u),
21
21
  w: countTransitions(g),
22
- c: a.length,
22
+ c: e.length,
23
23
  history: g?.history?.length,
24
24
  place: g?.place
25
25
  });
26
26
  if (o !== _.current) {
27
27
  _.current = o;
28
- let { nodes: i, edges: s } = buildWorkflowGraph(u, g, d.id, a, "LR");
29
- p(d.id, i, s);
28
+ let { nodes: a, edges: s } = buildWorkflowGraph(u, g, d.id, e, "LR");
29
+ p(d.id, a, s);
30
30
  }
31
31
  }, l[5] = p, l[6] = u, l[7] = f, l[8] = d.id, l[9] = g, l[10] = b) : b = l[10];
32
32
  let x;
@@ -2,12 +2,11 @@ import { ApiClientEvents } from "../../events/api-client-events.js";
2
2
  import { eventBus } from "../../services/eventEmitter.js";
3
3
  import "../../services/index.js";
4
4
  import { useStudio } from "../../providers/StudioProvider.js";
5
- import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "../../components/ui/sheet.js";
6
5
  import { useGetHealthInfo, useWorkerAuth, useWorkerAuthTokenRefresh } from "../../hooks/useAuth.js";
7
6
  import { useCallback, useEffect, useRef, useState } from "react";
8
7
  import { jsx, jsxs } from "react/jsx-runtime";
9
8
  import { useQueryClient } from "@tanstack/react-query";
10
- import { RefreshCw } from "lucide-react";
9
+ import { RefreshCw, X } from "lucide-react";
11
10
  const Escalation = {
12
11
  None: 0,
13
12
  Refresh: 1,
@@ -16,80 +15,94 @@ const Escalation = {
16
15
  Connection: 4
17
16
  };
18
17
  var LocalHealthCheck_default = () => {
19
- let { environment: b } = useStudio(), [x, S] = useState(Escalation.None), C = useWorkerAuth(), w = useWorkerAuthTokenRefresh(), T = useGetHealthInfo(!1), E = useQueryClient(), D = useRef(w);
20
- D.current = w;
21
- let O = useRef(C);
22
- O.current = C;
23
- let k = useRef(T);
24
- k.current = T;
25
- let A = useCallback(() => {
26
- k.current.refetch();
27
- }, []), j = useCallback(() => {
28
- D.current.mutate();
29
- }, []), M = useCallback(async () => {
18
+ let { environment: g } = useStudio(), [_, v] = useState(Escalation.None), y = useWorkerAuth(), b = useWorkerAuthTokenRefresh(), x = useGetHealthInfo(!1), S = useQueryClient(), C = useRef(b);
19
+ C.current = b;
20
+ let w = useRef(y);
21
+ w.current = y;
22
+ let T = useRef(x);
23
+ T.current = x;
24
+ let E = useCallback(() => {
25
+ T.current.refetch();
26
+ }, []), D = useCallback(() => {
27
+ C.current.mutate();
28
+ }, []), O = useCallback(async () => {
30
29
  try {
31
- let t = "local";
32
- b.getIdToken && (t = await b.getIdToken()), O.current.mutate({ hubLoginRequestDto: { idToken: t } });
30
+ let e = "local";
31
+ g.getIdToken && (e = await g.getIdToken()), w.current.mutate({ hubLoginRequestDto: { idToken: e } });
33
32
  } catch {
34
- S(Escalation.Debug);
33
+ v(Escalation.Debug);
35
34
  }
36
- }, [b]);
37
- return useEffect(() => {
38
- if (x !== Escalation.Connection) return;
39
- let t = setInterval(A, 5e3);
40
- return () => clearInterval(t);
41
- }, [x, A]), useEffect(() => {
42
- T.data && (S(Escalation.None), E.invalidateQueries());
43
- }, [T.data, E]), useEffect(() => {
44
- w.error && S(Escalation.Login);
45
- }, [w.error]), useEffect(() => {
46
- w.data?.status === 200 && S(Escalation.None);
47
- }, [w.data]), useEffect(() => {
48
- C.error && S(Escalation.Debug);
49
- }, [C.error]), useEffect(() => {
50
- C.data?.status === 200 && S(Escalation.None);
51
- }, [C.data]), useEffect(() => {
52
- x === Escalation.Refresh ? j() : x === Escalation.Login && M();
35
+ }, [g]);
36
+ useEffect(() => {
37
+ if (_ !== Escalation.Connection) return;
38
+ let e = setInterval(E, 5e3);
39
+ return () => clearInterval(e);
40
+ }, [_, E]), useEffect(() => {
41
+ x.data && (v(Escalation.None), S.invalidateQueries());
42
+ }, [x.data, S]), useEffect(() => {
43
+ b.error && v(Escalation.Login);
44
+ }, [b.error]), useEffect(() => {
45
+ b.data?.status === 200 && v(Escalation.None);
46
+ }, [b.data]), useEffect(() => {
47
+ y.error && v(Escalation.Debug);
48
+ }, [y.error]), useEffect(() => {
49
+ y.data?.status === 200 && v(Escalation.None);
50
+ }, [y.data]), useEffect(() => {
51
+ _ === Escalation.Refresh ? D() : _ === Escalation.Login && O();
53
52
  }, [
54
- x,
55
- j,
56
- M
53
+ _,
54
+ D,
55
+ O
57
56
  ]), useEffect(() => {
58
- let v = eventBus.on(ApiClientEvents.UNAUTHORIZED, () => {
59
- S(Escalation.Refresh);
60
- }), y = eventBus.on(ApiClientEvents.ERR_NETWORK, () => {
61
- S(Escalation.Connection);
57
+ let m = eventBus.on(ApiClientEvents.UNAUTHORIZED, () => {
58
+ v(Escalation.Refresh);
59
+ }), h = eventBus.on(ApiClientEvents.ERR_NETWORK, () => {
60
+ v(Escalation.Connection);
62
61
  });
63
62
  return () => {
64
- v(), y();
63
+ m(), h();
65
64
  };
66
- }, []), /* @__PURE__ */ jsx(Sheet, {
67
- open: x >= Escalation.Debug,
68
- children: /* @__PURE__ */ jsx(SheetContent, {
69
- side: "bottom",
70
- children: /* @__PURE__ */ jsx(SheetHeader, { children: /* @__PURE__ */ jsxs("div", {
71
- className: "flex w-full flex-row items-center justify-between",
72
- children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(SheetTitle, { children: "Connection issues detected" }), /* @__PURE__ */ jsxs(SheetDescription, { children: [
73
- "Please make sure the environment",
74
- " ",
75
- /* @__PURE__ */ jsxs("strong", { children: [
76
- b.name,
77
- " (",
78
- b.id,
79
- ")"
80
- ] }),
81
- " ",
82
- "is properly configured and running."
83
- ] })] }), x === Escalation.Connection && /* @__PURE__ */ jsx("div", {
84
- className: "mr-10",
85
- children: /* @__PURE__ */ jsxs("button", {
86
- onClick: A,
87
- className: "bg-primary flex items-center gap-2 rounded-md px-4 py-2 text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50",
88
- children: [/* @__PURE__ */ jsx(RefreshCw, { className: `h-3 w-3 ${T.isLoading ? "animate-spin" : ""}` }), "Retry"]
89
- })
65
+ }, []);
66
+ let [k, A] = useState(!1), j = _ >= Escalation.Debug && !k;
67
+ return useEffect(() => {
68
+ _ < Escalation.Debug && A(!1);
69
+ }, [_]), j ? /* @__PURE__ */ jsx("div", {
70
+ className: "bg-destructive/10 border-destructive/30 fixed inset-x-0 bottom-0 z-50 border-t px-4 py-3",
71
+ children: /* @__PURE__ */ jsxs("div", {
72
+ className: "flex items-center justify-between",
73
+ children: [/* @__PURE__ */ jsxs("div", {
74
+ className: "flex items-center gap-3",
75
+ children: [/* @__PURE__ */ jsx("div", { className: "bg-destructive h-2 w-2 rounded-full" }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
76
+ className: "text-foreground text-sm font-semibold",
77
+ children: "Connection issues detected"
78
+ }), /* @__PURE__ */ jsxs("p", {
79
+ className: "text-muted-foreground text-xs",
80
+ children: [
81
+ "Please make sure the environment",
82
+ " ",
83
+ /* @__PURE__ */ jsxs("strong", { children: [
84
+ g.name,
85
+ " (",
86
+ g.id,
87
+ ")"
88
+ ] }),
89
+ " ",
90
+ "is properly configured and running."
91
+ ]
92
+ })] })]
93
+ }), /* @__PURE__ */ jsxs("div", {
94
+ className: "flex items-center gap-2",
95
+ children: [_ === Escalation.Connection && /* @__PURE__ */ jsxs("button", {
96
+ onClick: E,
97
+ className: "bg-primary flex items-center gap-2 rounded-md px-3 py-1.5 text-sm text-white transition-colors disabled:cursor-not-allowed disabled:opacity-50",
98
+ children: [/* @__PURE__ */ jsx(RefreshCw, { className: `h-3 w-3 ${x.isLoading ? "animate-spin" : ""}` }), "Retry"]
99
+ }), /* @__PURE__ */ jsx("button", {
100
+ onClick: () => A(!0),
101
+ className: "text-muted-foreground hover:text-foreground rounded-xs p-1 transition-colors",
102
+ children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
90
103
  })]
91
- }) })
104
+ })]
92
105
  })
93
- });
106
+ }) : null;
94
107
  };
95
108
  export { LocalHealthCheck_default as default };
@@ -1,7 +1,7 @@
1
1
  import { useStudio } from "../../providers/StudioProvider.js";
2
+ import { useFetchWorkflowsByNamespace } from "../../hooks/useWorkflows.js";
2
3
  import { Skeleton } from "../../components/ui/skeleton.js";
3
4
  import { SidebarMenuSubItem } from "../../components/ui/sidebar.js";
4
- import { useFetchWorkflowsByNamespace } from "../../hooks/useWorkflows.js";
5
5
  import { WorkbenchContextProvider } from "./providers/WorkbenchContextProvider.js";
6
6
  import NavigationItem_default from "./components/NavigationItem.js";
7
7
  import { useScroll } from "./providers/ScrollProvider.js";
@@ -1,11 +1,11 @@
1
+ import { useFilterDocuments } from "../../hooks/useDocuments.js";
2
+ import { useWorkflow } from "../../hooks/useWorkflows.js";
1
3
  import { cn } from "../../lib/utils.js";
2
4
  import ErrorSnackbar_default from "../../components/snackbars/ErrorSnackbar.js";
3
5
  import LoadingCentered_default from "../../components/LoadingCentered.js";
4
6
  import { useRunPipeline } from "../../hooks/useProcessor.js";
5
7
  import DocumentList_default from "./components/DocumentList.js";
6
8
  import WorkflowForms_default from "./components/WorkflowForms.js";
7
- import { useFilterDocuments } from "../../hooks/useDocuments.js";
8
- import { useWorkflow } from "../../hooks/useWorkflows.js";
9
9
  import ErrorAlert_default from "../../components/content/ErrorAlert.js";
10
10
  import WorkflowButtons_default from "./components/buttons/WorkflowButtons.js";
11
11
  import React, { useCallback, useEffect, useMemo } from "react";
@@ -1,8 +1,8 @@
1
+ import { useFetchWorkflowsByPipeline } from "../../hooks/useWorkflows.js";
1
2
  import { cn } from "../../lib/utils.js";
2
3
  import { Button } from "../../components/ui/button.js";
3
4
  import ErrorSnackbar_default from "../../components/snackbars/ErrorSnackbar.js";
4
5
  import LoadingCentered_default from "../../components/LoadingCentered.js";
5
- import { useFetchWorkflowsByPipeline } from "../../hooks/useWorkflows.js";
6
6
  import WorkflowItem_default from "./WorkflowItem.js";
7
7
  import { useScrollToBottom } from "./hooks/useAutoScrollBottom.js";
8
8
  import { useIntersectionObserver } from "./hooks/useIntersectionObserver.js";
@@ -23,15 +23,15 @@ var WorkflowList_default = (S) => {
23
23
  }, C[1] = j) : j = C[1];
24
24
  let [M, N] = useState(j), { activeId: P, observe: F } = useIntersectionObserver("0px 0px 0px 0px"), { listRef: I, scrollTo: L } = useScrollToListItem(), { canScrollDown: R, scrollToBottom: z } = useScrollToBottom(), B = useContext(WorkbenchContextProvider), V, H;
25
25
  C[2] !== P || C[3] !== B ? (V = () => {
26
- B && B.setActiveSectionId && B.state.activeSectionId !== P && (B.setActiveSectionId(P), P && A((r) => ({
27
- ...r,
26
+ B && B.setActiveSectionId && B.state.activeSectionId !== P && (B.setActiveSectionId(P), P && A((t) => ({
27
+ ...t,
28
28
  [P]: !0
29
29
  })));
30
30
  }, H = [P, B], C[2] = P, C[3] = B, C[4] = V, C[5] = H) : (V = C[4], H = C[5]), useEffect(V, H);
31
31
  let U, W;
32
32
  C[6] !== P || C[7] !== T.data ? (U = () => {
33
33
  if (T.data && T.data.length > 0) {
34
- let r = T.data.length - 1, y = T.data[r], b = `section-${y.index}-${y.id}`;
34
+ let t = T.data.length - 1, y = T.data[t], b = `section-${y.index}-${y.id}`;
35
35
  A({
36
36
  [b]: !0,
37
37
  ...P && P !== b ? { [P]: !0 } : {}
@@ -39,10 +39,10 @@ var WorkflowList_default = (S) => {
39
39
  }
40
40
  }, W = [T.data, P], C[6] = P, C[7] = T.data, C[8] = U, C[9] = W) : (U = C[8], W = C[9]), useEffect(U, W);
41
41
  let G;
42
- C[10] === Symbol.for("react.memo_cache_sentinel") ? (G = (r) => {
42
+ C[10] === Symbol.for("react.memo_cache_sentinel") ? (G = (t) => {
43
43
  A((y) => ({
44
44
  ...y,
45
- [r]: !y[r]
45
+ [t]: !y[t]
46
46
  }));
47
47
  }, C[10] = G) : G = C[10];
48
48
  let K = G, q;
@@ -61,10 +61,10 @@ var WorkflowList_default = (S) => {
61
61
  C[18] !== P || C[19] !== k || C[20] !== T.data || C[21] !== I || C[22] !== F || C[23] !== E || C[24] !== w || C[25] !== L || C[26] !== M ? (X = T.data ? /* @__PURE__ */ jsx("div", {
62
62
  className: "mb-10",
63
63
  ref: I,
64
- children: /* @__PURE__ */ jsx("div", { children: T.data.map((y) => {
65
- let b = `section-${y.index}-${y.id}`, x = P === b;
64
+ children: /* @__PURE__ */ jsx("div", { children: T.data.map((t) => {
65
+ let b = `section-${t.index}-${t.id}`, x = P === b;
66
66
  return /* @__PURE__ */ jsxs("div", {
67
- ref: (r) => F(r),
67
+ ref: (t) => F(t),
68
68
  "data-id": b,
69
69
  className: "space-y-0",
70
70
  children: [/* @__PURE__ */ jsx("div", {
@@ -77,7 +77,7 @@ var WorkflowList_default = (S) => {
77
77
  /* @__PURE__ */ jsx(LayersIcon, { className: cn("size-4", x ? "text-primary" : "text-muted-foreground") }),
78
78
  /* @__PURE__ */ jsx("span", {
79
79
  className: cn("text-base font-medium transition-colors flex-1", x ? "text-primary" : "text-muted-foreground text-gray-400"),
80
- children: y.title ?? y.blockName
80
+ children: t.title ?? t.blockName
81
81
  }),
82
82
  x && /* @__PURE__ */ jsx(WorkbenchSettingsModal_default, {
83
83
  settings: M,
@@ -91,12 +91,12 @@ var WorkflowList_default = (S) => {
91
91
  className: "max-w-4xl pl-9",
92
92
  children: /* @__PURE__ */ jsx(WorkflowItem_default, {
93
93
  pipeline: w,
94
- workflowId: y.id,
94
+ workflowId: t.id,
95
95
  scrollTo: L,
96
96
  settings: M
97
97
  })
98
98
  })]
99
- }, y.id);
99
+ }, t.id);
100
100
  }) })
101
101
  }) : null, C[18] = P, C[19] = k, C[20] = T.data, C[21] = I, C[22] = F, C[23] = E, C[24] = w, C[25] = L, C[26] = M, C[27] = X) : X = C[27];
102
102
  let Z;
@@ -1,8 +1,8 @@
1
+ import { useWorkflow } from "../../../hooks/useWorkflows.js";
1
2
  import { cn } from "../../../lib/utils.js";
2
3
  import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../../components/ui/collapsible.js";
3
4
  import { Tooltip, TooltipContent, TooltipTrigger } from "../../../components/ui/tooltip.js";
4
5
  import { SidebarMenuButton, SidebarMenuItem, SidebarMenuSub } from "../../../components/ui/sidebar.js";
5
- import { useWorkflow } from "../../../hooks/useWorkflows.js";
6
6
  import { c } from "react/compiler-runtime";
7
7
  import React from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -11,14 +11,14 @@ import { format } from "date-fns";
11
11
  var WorkflowHistoryItem_default = (x) => {
12
12
  let S = c(19), { workflowId: C, workflow: w } = x, T = useWorkflow(C), E = T.data?.history;
13
13
  if (T.isLoading) {
14
- let t;
15
- return S[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(SidebarMenuButton, {
14
+ let e;
15
+ return S[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(SidebarMenuButton, {
16
16
  className: "opacity-50",
17
17
  children: [/* @__PURE__ */ jsx(Loader2, { className: "h-3 w-3 animate-spin" }), /* @__PURE__ */ jsx("span", {
18
18
  className: "text-sm",
19
19
  children: "Loading..."
20
20
  })]
21
- }) }), S[0] = t) : t = S[0], t;
21
+ }) }), S[0] = e) : e = S[0], e;
22
22
  }
23
23
  if (!E?.length) return null;
24
24
  let D;
@@ -62,10 +62,10 @@ var WorkflowHistoryItem_default = (x) => {
62
62
  }), S[9] = P) : P = S[9];
63
63
  let F;
64
64
  if (S[10] !== E) {
65
- let m;
66
- S[12] === E.length ? m = S[13] : (m = (m, h) => {
67
- console.log(m);
68
- let g = m.data?.transition, _ = Object.keys(m.data?.tools ?? {}), v = h === E.length - 1, y = m.data?.place ?? g?.to ?? "unknown", b = g?.id;
65
+ let e;
66
+ S[12] === E.length ? e = S[13] : (e = (e, h) => {
67
+ 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;
69
69
  return /* @__PURE__ */ jsxs("div", {
70
70
  className: "group/entry relative flex gap-3 py-1 pl-0",
71
71
  children: [/* @__PURE__ */ jsx("div", {
@@ -114,13 +114,13 @@ var WorkflowHistoryItem_default = (x) => {
114
114
  className: "flex items-center gap-0.5",
115
115
  children: [/* @__PURE__ */ jsx(Clock, { className: "h-3 w-3" }), /* @__PURE__ */ jsx("span", {
116
116
  className: "tabular-nums",
117
- children: format(new Date(m.timestamp), "HH:mm:ss")
117
+ children: format(new Date(e.timestamp), "HH:mm:ss")
118
118
  })]
119
119
  })]
120
120
  })]
121
121
  })]
122
- }, m.version);
123
- }, S[12] = E.length, S[13] = m), F = E.map(m), S[10] = E, S[11] = F;
122
+ }, e.version);
123
+ }, S[12] = E.length, S[13] = e), F = E.map(e), S[10] = E, S[11] = F;
124
124
  } else F = S[11];
125
125
  let I;
126
126
  S[14] === F ? I = S[15] : (I = /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx(SidebarMenuSub, {
@@ -1,8 +1,8 @@
1
1
  import { useStudio } from "../../../../providers/StudioProvider.js";
2
+ import { useDeleteWorkflow } from "../../../../hooks/useWorkflows.js";
2
3
  import { Button } from "../../../../components/ui/button.js";
3
4
  import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "../../../../components/ui/alert-dialog.js";
4
5
  import { useRunPipeline } from "../../../../hooks/useProcessor.js";
5
- import { useDeleteWorkflow } from "../../../../hooks/useWorkflows.js";
6
6
  import { c } from "react/compiler-runtime";
7
7
  import React from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -14,52 +14,52 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
14
14
  import { useSearchParams } from "react-router-dom";
15
15
  import { Star } from "lucide-react";
16
16
  var Workspaces_default = () => {
17
- let n = c(65), { CreateWorkspace: Oe } = useComponentOverrides(), r = Oe ?? CreateWorkspace_default, { router: i } = useStudio(), [a] = useSearchParams(), [o, ke] = useState(0), [s, Ae] = useState(10), [l, je] = useState("createdAt"), [u, Me] = useState("ASC"), [d, Ne] = useState(), f;
17
+ let n = c(65), { CreateWorkspace: Oe, EditWorkspace: ke } = useComponentOverrides(), r = Oe ?? CreateWorkspace_default, i = ke ?? CreateWorkspace_default, { router: Ae } = useStudio(), [a] = useSearchParams(), [o, je] = useState(0), [s, Me] = useState(10), [l, Ne] = useState("createdAt"), [u, Pe] = useState("ASC"), [d, Fe] = useState(), f;
18
18
  n[0] === Symbol.for("react.memo_cache_sentinel") ? (f = {}, n[0] = f) : f = n[0];
19
- let [p, Pe] = useState(f), Fe = useDebounce(d, 500), [m, h] = useState(!1), [g, Ie] = useState(void 0), _, v;
19
+ let [p, Ie] = useState(f), Le = useDebounce(d, 500), [m, h] = useState(!1), [g, Re] = useState(void 0), _, v;
20
20
  n[1] === a ? (_ = n[2], v = n[3]) : (_ = () => {
21
21
  a.get("create") === "true" && h(!0);
22
22
  }, v = [a], n[1] = a, n[2] = _, n[3] = v), useEffect(_, v);
23
- let y = useWorkspaceConfig(), b = useFilterWorkspaces(Fe, p, l, u, o, s), x = useDeleteWorkspace(), S = useBatchDeleteWorkspaces(), C = useSetFavouriteWorkspace(), w;
24
- n[4] === x ? w = n[5] : (w = (e) => {
23
+ let y = useWorkspaceConfig(), b = useFilterWorkspaces(Le, p, l, u, o, s), x = useDeleteWorkspace(), ze = useBatchDeleteWorkspaces(), S = useSetFavouriteWorkspace(), C;
24
+ n[4] === x ? C = n[5] : (C = (e) => {
25
25
  x.mutate(e);
26
- }, n[4] = x, n[5] = w);
27
- let Le = w, T;
28
- n[6] === S ? T = n[7] : (T = (e) => {
29
- S.mutate(e);
30
- }, n[6] = S, n[7] = T);
26
+ }, n[4] = x, n[5] = C);
27
+ let w = C, T;
28
+ n[6] === ze ? T = n[7] : (T = (e) => {
29
+ ze.mutate(e);
30
+ }, n[6] = ze, n[7] = T);
31
31
  let E = T, D;
32
32
  n[8] === Symbol.for("react.memo_cache_sentinel") ? (D = () => {
33
33
  h(!0);
34
34
  }, n[8] = D) : D = n[8];
35
- let Re = D, O;
35
+ let Be = D, O;
36
36
  n[9] === Symbol.for("react.memo_cache_sentinel") ? (O = () => {
37
37
  h(!1);
38
38
  }, n[9] = O) : O = n[9];
39
- let ze = O, k;
40
- n[10] === i ? k = n[11] : (k = (e) => {
41
- i.navigateToWorkspace(e);
42
- }, n[10] = i, n[11] = k);
39
+ let Ve = O, k;
40
+ n[10] === Ae ? k = n[11] : (k = (e) => {
41
+ Ae.navigateToWorkspace(e);
42
+ }, n[10] = Ae, n[11] = k);
43
43
  let A = k, j;
44
44
  n[12] === Symbol.for("react.memo_cache_sentinel") ? (j = (e) => {
45
- Ie(e);
45
+ Re(e);
46
46
  }, n[12] = j) : j = n[12];
47
- let Be = j, M;
47
+ let He = j, M;
48
48
  n[13] === Symbol.for("react.memo_cache_sentinel") ? (M = () => {
49
- h(!1), Ie(void 0);
49
+ h(!1), Re(void 0);
50
50
  }, n[13] = M) : M = n[13];
51
- let Ve = M, He = y.isPending || b.isPending, Ue = b.error ?? y.error ?? null, N;
52
- n[14] === b.data?.data ? N = n[15] : (N = b.data?.data ?? [], n[14] = b.data?.data, n[15] = N);
53
- let P = b.data?.total ?? 0, F;
54
- n[16] === Symbol.for("react.memo_cache_sentinel") ? (F = {
51
+ let Ue = M, N = y.isPending || b.isPending, P = b.error ?? y.error ?? null, F;
52
+ n[14] === b.data?.data ? F = n[15] : (F = b.data?.data ?? [], n[14] = b.data?.data, n[15] = F);
53
+ let I = b.data?.total ?? 0, L;
54
+ n[16] === Symbol.for("react.memo_cache_sentinel") ? (L = {
55
55
  id: "id",
56
56
  label: "ID",
57
57
  minWidth: 30,
58
58
  format: _temp
59
- }, n[16] = F) : F = n[16];
60
- let I;
61
- n[17] === Symbol.for("react.memo_cache_sentinel") ? (I = [
62
- F,
59
+ }, n[16] = L) : L = n[16];
60
+ let R;
61
+ n[17] === Symbol.for("react.memo_cache_sentinel") ? (R = [
62
+ L,
63
63
  {
64
64
  id: "title",
65
65
  label: "Title",
@@ -69,7 +69,7 @@ var Workspaces_default = () => {
69
69
  children: /* @__PURE__ */ jsx(Badge, {
70
70
  variant: "outline",
71
71
  className: "hover:bg-primary/10 cursor-pointer",
72
- onClick: () => Pe((t) => ({
72
+ onClick: () => Ie((t) => ({
73
73
  ...t,
74
74
  blockName: e
75
75
  })),
@@ -89,110 +89,110 @@ var Workspaces_default = () => {
89
89
  minWidth: 100,
90
90
  format: _temp4
91
91
  }
92
- ], n[17] = I) : I = n[17];
93
- let L;
94
- n[18] === Symbol.for("react.memo_cache_sentinel") ? (L = {}, n[18] = L) : L = n[18];
95
- let R;
96
- n[19] === Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ jsx(Star, { className: "h-4 w-4" }), n[19] = R) : R = n[19];
92
+ ], n[17] = R) : R = n[17];
97
93
  let z;
98
- n[20] === C ? z = n[21] : (z = {
94
+ n[18] === Symbol.for("react.memo_cache_sentinel") ? (z = {}, n[18] = z) : z = n[18];
95
+ let B;
96
+ n[19] === Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ jsx(Star, { className: "h-4 w-4" }), n[19] = B) : B = n[19];
97
+ let V;
98
+ n[20] === S ? V = n[21] : (V = {
99
99
  id: "add-favourite",
100
100
  label: "Add to favourites",
101
- icon: R,
101
+ icon: B,
102
102
  condition: _temp5,
103
103
  action: (e) => {
104
- C.mutate({
104
+ S.mutate({
105
105
  id: e.id,
106
106
  isFavourite: !0
107
107
  });
108
108
  }
109
- }, n[20] = C, n[21] = z);
110
- let B;
111
- n[22] === Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ jsx(Star, { className: "h-4 w-4 fill-current" }), n[22] = B) : B = n[22];
112
- let V;
113
- n[23] === C ? V = n[24] : (V = {
109
+ }, n[20] = S, n[21] = V);
110
+ let H;
111
+ n[22] === Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ jsx(Star, { className: "h-4 w-4 fill-current" }), n[22] = H) : H = n[22];
112
+ let U;
113
+ n[23] === S ? U = n[24] : (U = {
114
114
  id: "remove-favourite",
115
115
  label: "Remove from favourites",
116
- icon: B,
116
+ icon: H,
117
117
  condition: _temp6,
118
118
  action: (e) => {
119
- C.mutate({
119
+ S.mutate({
120
120
  id: e.id,
121
121
  isFavourite: !1
122
122
  });
123
123
  }
124
- }, n[23] = C, n[24] = V);
125
- let H;
126
- n[25] !== z || n[26] !== V ? (H = [z, V], n[25] = z, n[26] = V, n[27] = H) : H = n[27];
127
- let U = H, W;
128
- n[28] !== p || n[29] !== E || n[30] !== Le || n[31] !== A || n[32] !== u || n[33] !== l || n[34] !== o || n[35] !== s || n[36] !== d || n[37] !== He || n[38] !== Ue || n[39] !== N || n[40] !== P || n[41] !== U ? (W = /* @__PURE__ */ jsx(ListView_default, {
129
- loading: He,
130
- error: Ue,
131
- items: N,
132
- totalItems: P,
133
- setPage: ke,
134
- setRowsPerPage: Ae,
135
- setOrderBy: je,
136
- setOrder: Me,
137
- setSearchTerm: Ne,
138
- setFilters: Pe,
124
+ }, n[23] = S, n[24] = U);
125
+ let W;
126
+ n[25] !== V || n[26] !== U ? (W = [V, U], n[25] = V, n[26] = U, n[27] = W) : W = n[27];
127
+ let We = W, G;
128
+ n[28] !== p || n[29] !== E || n[30] !== w || n[31] !== A || n[32] !== u || n[33] !== l || n[34] !== o || n[35] !== s || n[36] !== d || n[37] !== N || n[38] !== P || n[39] !== F || n[40] !== I || n[41] !== We ? (G = /* @__PURE__ */ jsx(ListView_default, {
129
+ loading: N,
130
+ error: P,
131
+ items: F,
132
+ totalItems: I,
133
+ setPage: je,
134
+ setRowsPerPage: Me,
135
+ setOrderBy: Ne,
136
+ setOrder: Pe,
137
+ setSearchTerm: Fe,
138
+ setFilters: Ie,
139
139
  orderBy: l,
140
140
  order: u,
141
141
  searchTerm: d,
142
142
  filters: p,
143
143
  page: o,
144
144
  rowsPerPage: s,
145
- deleteItem: Le,
145
+ deleteItem: w,
146
146
  onClick: A,
147
- handleNew: Re,
148
- handleEdit: Be,
147
+ handleNew: Be,
148
+ handleEdit: He,
149
149
  enableBatchActions: !0,
150
150
  batchDelete: E,
151
- columns: I,
152
- filterConfig: L,
153
- rowActions: U
154
- }), n[28] = p, n[29] = E, n[30] = Le, n[31] = A, n[32] = u, n[33] = l, n[34] = o, n[35] = s, n[36] = d, n[37] = He, n[38] = Ue, n[39] = N, n[40] = P, n[41] = U, n[42] = W) : W = n[42];
155
- let G;
156
- n[43] === y.data ? G = n[44] : (G = y.data ?? [], n[43] = y.data, n[44] = G);
151
+ columns: R,
152
+ filterConfig: z,
153
+ rowActions: We
154
+ }), n[28] = p, n[29] = E, n[30] = w, n[31] = A, n[32] = u, n[33] = l, n[34] = o, n[35] = s, n[36] = d, n[37] = N, n[38] = P, n[39] = F, n[40] = I, n[41] = We, n[42] = G) : G = n[42];
157
155
  let K;
158
- n[45] !== r || n[46] !== G ? (K = /* @__PURE__ */ jsx(DialogContent, {
156
+ n[43] === y.data ? K = n[44] : (K = y.data ?? [], n[43] = y.data, n[44] = K);
157
+ let q;
158
+ n[45] !== r || n[46] !== K ? (q = /* @__PURE__ */ jsx(DialogContent, {
159
159
  className: "max-w-2xl",
160
160
  children: /* @__PURE__ */ jsx(r, {
161
- types: G,
162
- onSuccess: ze
161
+ types: K,
162
+ onSuccess: Ve
163
163
  })
164
- }), n[45] = r, n[46] = G, n[47] = K) : K = n[47];
165
- let q;
166
- n[48] !== m || n[49] !== K ? (q = /* @__PURE__ */ jsx(Dialog, {
164
+ }), n[45] = r, n[46] = K, n[47] = q) : q = n[47];
165
+ let J;
166
+ n[48] !== m || n[49] !== q ? (J = /* @__PURE__ */ jsx(Dialog, {
167
167
  open: m,
168
168
  onOpenChange: h,
169
- children: K
170
- }), n[48] = m, n[49] = K, n[50] = q) : q = n[50];
171
- let J = !!g, Y;
172
- n[51] === Symbol.for("react.memo_cache_sentinel") ? (Y = (e) => !e && Ve(), n[51] = Y) : Y = n[51];
169
+ children: q
170
+ }), n[48] = m, n[49] = q, n[50] = J) : J = n[50];
171
+ let Ge = !!g, Y;
172
+ n[51] === Symbol.for("react.memo_cache_sentinel") ? (Y = (e) => !e && Ue(), n[51] = Y) : Y = n[51];
173
173
  let X;
174
- n[52] === y.data ? X = n[53] : (X = y.data ?? [], n[52] = y.data, n[53] = X);
174
+ n[52] !== i || n[53] !== y.data || n[54] !== g ? (X = g && /* @__PURE__ */ jsx(i, {
175
+ types: y.data ?? [],
176
+ workspace: g,
177
+ onSuccess: Ue
178
+ }), n[52] = i, n[53] = y.data, n[54] = g, n[55] = X) : X = n[55];
175
179
  let Z;
176
- n[54] !== r || n[55] !== g || n[56] !== X ? (Z = /* @__PURE__ */ jsx(DialogContent, {
180
+ n[56] === X ? Z = n[57] : (Z = /* @__PURE__ */ jsx(DialogContent, {
177
181
  className: "max-w-2xl",
178
- children: /* @__PURE__ */ jsx(r, {
179
- types: X,
180
- workspace: g,
181
- onSuccess: Ve
182
- })
183
- }), n[54] = r, n[55] = g, n[56] = X, n[57] = Z) : Z = n[57];
182
+ children: X
183
+ }), n[56] = X, n[57] = Z);
184
184
  let Q;
185
- n[58] !== J || n[59] !== Z ? (Q = /* @__PURE__ */ jsx(Dialog, {
186
- open: J,
185
+ n[58] !== Ge || n[59] !== Z ? (Q = /* @__PURE__ */ jsx(Dialog, {
186
+ open: Ge,
187
187
  onOpenChange: Y,
188
188
  children: Z
189
- }), n[58] = J, n[59] = Z, n[60] = Q) : Q = n[60];
189
+ }), n[58] = Ge, n[59] = Z, n[60] = Q) : Q = n[60];
190
190
  let $;
191
- return n[61] !== W || n[62] !== q || n[63] !== Q ? ($ = /* @__PURE__ */ jsxs(Fragment$1, { children: [
192
- W,
193
- q,
191
+ return n[61] !== G || n[62] !== J || n[63] !== Q ? ($ = /* @__PURE__ */ jsxs(Fragment$1, { children: [
192
+ G,
193
+ J,
194
194
  Q
195
- ] }), n[61] = W, n[62] = q, n[63] = Q, n[64] = $) : $ = n[64], $;
195
+ ] }), n[61] = G, n[62] = J, n[63] = Q, n[64] = $) : $ = n[64], $;
196
196
  };
197
197
  function _temp(e) {
198
198
  return e.slice(0, 6);
@@ -1,15 +1,36 @@
1
1
  import { useApiClient } from "./useApi.js";
2
2
  import { c } from "react/compiler-runtime";
3
3
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
4
- function useGetHealthInfo(n) {
4
+ function useMe(n) {
5
5
  let i = c(8), a = n === void 0 ? !0 : n, { envKey: s, api: l } = useApiClient(), u;
6
- i[0] === s ? u = i[1] : (u = ["health", s], i[0] = s, i[1] = u);
6
+ i[0] === s ? u = i[1] : (u = ["me", s], i[0] = s, i[1] = u);
7
7
  let d;
8
8
  i[2] === l ? d = i[3] : (d = () => {
9
9
  if (!l) throw Error("API not available");
10
- return l.ApiV1AuthApi.authControllerGetInfo();
10
+ return l.ApiV1AuthApi.authControllerMe();
11
11
  }, i[2] = l, i[3] = d);
12
12
  let f;
13
+ return i[4] !== a || i[5] !== u || i[6] !== d ? (f = {
14
+ queryKey: u,
15
+ queryFn: d,
16
+ select: _temp,
17
+ retry: !1,
18
+ staleTime: 3e5,
19
+ enabled: a
20
+ }, i[4] = a, i[5] = u, i[6] = d, i[7] = f) : f = i[7], useQuery(f);
21
+ }
22
+ function _temp(e) {
23
+ return e.data;
24
+ }
25
+ function useGetHealthInfo(n) {
26
+ let i = c(8), a = n === void 0 ? !0 : n, { envKey: o, api: s } = useApiClient(), u;
27
+ i[0] === o ? u = i[1] : (u = ["health", o], i[0] = o, i[1] = u);
28
+ let d;
29
+ i[2] === s ? d = i[3] : (d = () => {
30
+ if (!s) throw Error("API not available");
31
+ return s.ApiV1AuthApi.authControllerGetInfo();
32
+ }, i[2] = s, i[3] = d);
33
+ let f;
13
34
  return i[4] !== a || i[5] !== u || i[6] !== d ? (f = {
14
35
  queryKey: u,
15
36
  queryFn: d,
@@ -53,4 +74,4 @@ function useWorkerAuthTokenRefresh() {
53
74
  onSuccess: l
54
75
  }, r[4] = s, r[5] = l, r[6] = u) : u = r[6], useMutation(u);
55
76
  }
56
- export { useGetHealthInfo, useWorkerAuth, useWorkerAuthTokenRefresh };
77
+ export { useGetHealthInfo, useMe, useWorkerAuth, useWorkerAuthTokenRefresh };
@@ -42,4 +42,4 @@ function useFilterDocuments(a) {
42
42
  function _temp2(e) {
43
43
  return e.data.data;
44
44
  }
45
- export { useFilterDocuments };
45
+ export { getDocumentsCacheKey, useFilterDocuments };
@@ -31,4 +31,4 @@ function useFilterNamespaces(a) {
31
31
  function _temp2(e) {
32
32
  return e.data.data;
33
33
  }
34
- export { useFilterNamespaces };
34
+ export { getNamespacesByPipelineCacheKey, useFilterNamespaces };
@@ -119,4 +119,4 @@ function useDeleteWorkflow() {
119
119
  onSuccess: p
120
120
  }, r[5] = f, r[6] = p, r[7] = m) : m = r[7], useMutation(m);
121
121
  }
122
- export { useDeleteWorkflow, useFetchWorkflowsByNamespace, useFetchWorkflowsByPipeline, useWorkflow };
122
+ export { getWorkflowCacheKey, getWorkflowsByPipelineCacheKey, getWorkflowsCacheKey, useDeleteWorkflow, useFetchWorkflowsByNamespace, useFetchWorkflowsByPipeline, useWorkflow };
package/dist/index.d.ts CHANGED
@@ -41,6 +41,7 @@ import { useNavigate } from 'react-router-dom';
41
41
  import { UseQueryResult } from '@tanstack/react-query';
42
42
  import { VariantProps } from 'class-variance-authority';
43
43
  import { WorkspaceConfigDto } from '../../../../client/api-client';
44
+ import { WorkspaceConfigDto as WorkspaceConfigDto_2 } from '../../client/api-client';
44
45
  import { WorkspaceControllerBatchDeleteWorkspaces200Response } from '../../client/api-client';
45
46
  import { WorkspaceControllerGetWorkspaces200Response } from '../../client/api-client';
46
47
  import { WorkspaceDto } from '../../client/api-client';
@@ -203,6 +204,7 @@ declare interface CompletionMessagePaperProps {
203
204
 
204
205
  export declare interface ComponentOverrides {
205
206
  CreateWorkspace?: ComponentType<CreateWorkspaceProps>;
207
+ EditWorkspace?: ComponentType<EditWorkspaceProps>;
206
208
  }
207
209
 
208
210
  export declare const ComponentOverridesProvider: ({ children, overrides, }: {
@@ -446,6 +448,12 @@ export declare function DropdownMenuSubTrigger({ className, inset, children, ...
446
448
 
447
449
  export declare function DropdownMenuTrigger({ ...props }: React_2.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): JSX.Element;
448
450
 
451
+ export declare interface EditWorkspaceProps {
452
+ types: WorkspaceConfigDto_2[];
453
+ workspace: WorkspaceItemDto_2;
454
+ onSuccess: () => void;
455
+ }
456
+
449
457
  export declare function EmbedWorkbenchPage(): JSX.Element;
450
458
 
451
459
  export declare interface Environment {
@@ -477,6 +485,8 @@ declare interface GoogleLogoProps {
477
485
 
478
486
  export declare function Input({ className, type, ...props }: React_2.ComponentProps<'input'>): JSX.Element;
479
487
 
488
+ export declare function InvalidationEventsProvider(): null;
489
+
480
490
  declare interface Item {
481
491
  id: string;
482
492
  }
@@ -553,7 +563,7 @@ declare interface LoadingCenteredProps extends default_2.HTMLAttributes<HTMLDivE
553
563
  children?: default_2.ReactNode;
554
564
  }
555
565
 
556
- export declare const LocalHealthCheck: () => JSX.Element;
566
+ export declare const LocalHealthCheck: () => JSX.Element | null;
557
567
 
558
568
  export declare class LocalRouter implements StudioRouter {
559
569
  private navigate;
@@ -814,6 +824,8 @@ export declare function Slider({ className, defaultValue, value, min, max, ...pr
814
824
 
815
825
  export declare const Snackbar: default_2.FC<BaseSnackbarProps>;
816
826
 
827
+ export declare function SseProvider(): null;
828
+
817
829
  declare interface StudioContext {
818
830
  router: StudioRouter;
819
831
  environment: Environment;
package/dist/index.js CHANGED
@@ -7,6 +7,8 @@ import { useIsMobile } from "./hooks/use-mobile.js";
7
7
  import { useBatchDeleteWorkspaces, useCreateWorkspace, useDeleteWorkspace, useFilterWorkspaces, useSetFavouriteWorkspace, useUpdateWorkspace, useWorkspace } from "./hooks/useWorkspaces.js";
8
8
  import "./hooks/index.js";
9
9
  import { ComponentOverridesProvider, useComponentOverrides } from "./providers/ComponentOverridesProvider.js";
10
+ import { SseProvider } from "./providers/SseProvider.js";
11
+ import { InvalidationEventsProvider } from "./providers/InvalidationEventsProvider.js";
10
12
  import { LocalRouter, useRouter } from "./routing/LocalRouter.js";
11
13
  import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./components/ui/accordion.js";
12
14
  import { Button, buttonVariants } from "./components/ui/button.js";
@@ -64,4 +66,4 @@ import DebugWorkflowsPage from "./pages/DebugWorkflowsPage.js";
64
66
  import DebugWorkflowDetailsPage from "./pages/DebugWorkflowDetailsPage.js";
65
67
  import EmbedWorkbenchPage from "./pages/EmbedWorkbenchPage.js";
66
68
  import LocalHealthCheck_default from "./features/health/LocalHealthCheck.js";
67
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, CompletionMessagePaper_default as CompletionMessagePaper, ComponentOverridesProvider, ConfirmDialog_default as ConfirmDialog, CustomListView_default as CustomItemListView, DashboardPage, DataList, DataTable, DataTableBatchAction_default as DataTableBatchActions, DataTableFilters_default as DataTableFilters, DataTablePagination_default as DataTablePagination, DataTableToolbar_default as DataTableToolbar, DebugPage_default as DebugPage, DebugWorkflowDetailsPage, DebugWorkflowsPage, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiscordLogo, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmbedWorkbenchPage, ErrorSnackbar_default as ErrorSnackbar, GoogleLogo, Input, ListView_default as ItemListView, Label, LoadingCentered_default as LoadingCentered, LocalHealthCheck_default as LocalHealthCheck, LocalRouter, MainLayout_default as MainLayout, PageBreadcrumbs_default as PageBreadcrumbs, PipelineDebugPage_default as PipelineDebugPage, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarInsetDiv, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuDiv, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Snackbar_default as Snackbar, StudioProvider, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, WorkbenchPage, WorkspacePage_default as WorkspacePage, WorkspacesPage, badgeVariants, buttonVariants, createApiClient, eventBus, useApiClient, useBatchDeleteWorkspaces, useComponentOverrides, useCreateWorkspace, useDeleteWorkspace, useFilterWorkspaces, useIsMobile, useRouter, useSetFavouriteWorkspace, useSidebar, useStudio, useUpdateWorkspace, useWorkspace };
69
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, CompletionMessagePaper_default as CompletionMessagePaper, ComponentOverridesProvider, ConfirmDialog_default as ConfirmDialog, CustomListView_default as CustomItemListView, DashboardPage, DataList, DataTable, DataTableBatchAction_default as DataTableBatchActions, DataTableFilters_default as DataTableFilters, DataTablePagination_default as DataTablePagination, DataTableToolbar_default as DataTableToolbar, DebugPage_default as DebugPage, DebugWorkflowDetailsPage, DebugWorkflowsPage, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiscordLogo, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmbedWorkbenchPage, ErrorSnackbar_default as ErrorSnackbar, GoogleLogo, Input, InvalidationEventsProvider, ListView_default as ItemListView, Label, LoadingCentered_default as LoadingCentered, LocalHealthCheck_default as LocalHealthCheck, LocalRouter, MainLayout_default as MainLayout, PageBreadcrumbs_default as PageBreadcrumbs, PipelineDebugPage_default as PipelineDebugPage, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, RadioGroup, RadioGroupItem, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarInsetDiv, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuDiv, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Snackbar_default as Snackbar, SseProvider, StudioProvider, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, WorkbenchPage, WorkspacePage_default as WorkspacePage, WorkspacesPage, badgeVariants, buttonVariants, createApiClient, eventBus, useApiClient, useBatchDeleteWorkspaces, useComponentOverrides, useCreateWorkspace, useDeleteWorkspace, useFilterWorkspaces, useIsMobile, useRouter, useSetFavouriteWorkspace, useSidebar, useStudio, useUpdateWorkspace, useWorkspace };
@@ -0,0 +1,7 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.js";
2
+ import { require__root } from "./_root.js";
3
+ var require__Symbol = /* @__PURE__ */ __commonJSMin(((e, n) => {
4
+ n.exports = require__root().Symbol;
5
+ }));
6
+ export default require__Symbol();
7
+ export { require__Symbol };
@@ -0,0 +1,13 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.js";
2
+ import { require__Symbol } from "./_Symbol.js";
3
+ import { require__getRawTag } from "./_getRawTag.js";
4
+ import { require__objectToString } from "./_objectToString.js";
5
+ var require__baseGetTag = /* @__PURE__ */ __commonJSMin(((e, i) => {
6
+ var a = require__Symbol(), o = require__getRawTag(), s = require__objectToString(), c = "[object Null]", l = "[object Undefined]", u = a ? a.toStringTag : void 0;
7
+ function d(e) {
8
+ return e == null ? e === void 0 ? l : c : u && u in Object(e) ? o(e) : s(e);
9
+ }
10
+ i.exports = d;
11
+ }));
12
+ export default require__baseGetTag();
13
+ export { require__baseGetTag };
@@ -0,0 +1,11 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.js";
2
+ import { require__trimmedEndIndex } from "./_trimmedEndIndex.js";
3
+ var require__baseTrim = /* @__PURE__ */ __commonJSMin(((e, n) => {
4
+ var r = require__trimmedEndIndex(), i = /^\s+/;
5
+ function a(e) {
6
+ return e && e.slice(0, r(e) + 1).replace(i, "");
7
+ }
8
+ n.exports = a;
9
+ }));
10
+ export default require__baseTrim();
11
+ export { require__baseTrim };
@@ -0,0 +1,6 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.js";
2
+ var require__freeGlobal = /* @__PURE__ */ __commonJSMin(((e, t) => {
3
+ t.exports = typeof global == "object" && global && global.Object === Object && global;
4
+ }));
5
+ export default require__freeGlobal();
6
+ export { require__freeGlobal };
@@ -0,0 +1,17 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.js";
2
+ import { require__Symbol } from "./_Symbol.js";
3
+ var require__getRawTag = /* @__PURE__ */ __commonJSMin(((e, n) => {
4
+ var r = require__Symbol(), i = Object.prototype, a = i.hasOwnProperty, o = i.toString, s = r ? r.toStringTag : void 0;
5
+ function c(e) {
6
+ var t = a.call(e, s), n = e[s];
7
+ try {
8
+ e[s] = void 0;
9
+ var r = !0;
10
+ } catch {}
11
+ var i = o.call(e);
12
+ return r && (t ? e[s] = n : delete e[s]), i;
13
+ }
14
+ n.exports = c;
15
+ }));
16
+ export default require__getRawTag();
17
+ export { require__getRawTag };
@@ -0,0 +1,10 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.js";
2
+ var require__objectToString = /* @__PURE__ */ __commonJSMin(((e, t) => {
3
+ var n = Object.prototype.toString;
4
+ function r(e) {
5
+ return n.call(e);
6
+ }
7
+ t.exports = r;
8
+ }));
9
+ export default require__objectToString();
10
+ export { require__objectToString };
@@ -0,0 +1,8 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.js";
2
+ import { require__freeGlobal } from "./_freeGlobal.js";
3
+ var require__root = /* @__PURE__ */ __commonJSMin(((e, n) => {
4
+ var r = require__freeGlobal(), i = typeof self == "object" && self && self.Object === Object && self;
5
+ n.exports = r || i || Function("return this")();
6
+ }));
7
+ export default require__root();
8
+ export { require__root };
@@ -0,0 +1,11 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.js";
2
+ var require__trimmedEndIndex = /* @__PURE__ */ __commonJSMin(((e, t) => {
3
+ var n = /\s/;
4
+ function r(e) {
5
+ for (var t = e.length; t-- && n.test(e.charAt(t)););
6
+ return t;
7
+ }
8
+ t.exports = r;
9
+ }));
10
+ export default require__trimmedEndIndex();
11
+ export { require__trimmedEndIndex };
@@ -0,0 +1,53 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.js";
2
+ import { require_isObject } from "./isObject.js";
3
+ import { require_now } from "./now.js";
4
+ import { require_toNumber } from "./toNumber.js";
5
+ var require_debounce = /* @__PURE__ */ __commonJSMin(((e, i) => {
6
+ var a = require_isObject(), o = require_now(), s = require_toNumber(), c = "Expected a function", l = Math.max, u = Math.min;
7
+ function d(e, t, n) {
8
+ var r, i, d, f, p, m, h = 0, g = !1, _ = !1, v = !0;
9
+ if (typeof e != "function") throw TypeError(c);
10
+ t = s(t) || 0, a(n) && (g = !!n.leading, _ = "maxWait" in n, d = _ ? l(s(n.maxWait) || 0, t) : d, v = "trailing" in n ? !!n.trailing : v);
11
+ function y(t) {
12
+ var n = r, a = i;
13
+ return r = i = void 0, h = t, f = e.apply(a, n), f;
14
+ }
15
+ function b(e) {
16
+ return h = e, p = setTimeout(C, t), g ? y(e) : f;
17
+ }
18
+ function x(e) {
19
+ var n = e - m, r = e - h, i = t - n;
20
+ return _ ? u(i, d - r) : i;
21
+ }
22
+ function S(e) {
23
+ var n = e - m, r = e - h;
24
+ return m === void 0 || n >= t || n < 0 || _ && r >= d;
25
+ }
26
+ function C() {
27
+ var e = o();
28
+ if (S(e)) return w(e);
29
+ p = setTimeout(C, x(e));
30
+ }
31
+ function w(e) {
32
+ return p = void 0, v && r ? y(e) : (r = i = void 0, f);
33
+ }
34
+ function T() {
35
+ p !== void 0 && clearTimeout(p), h = 0, r = m = i = p = void 0;
36
+ }
37
+ function E() {
38
+ return p === void 0 ? f : w(o());
39
+ }
40
+ function D() {
41
+ var e = o(), n = S(e);
42
+ if (r = arguments, i = this, m = e, n) {
43
+ if (p === void 0) return b(m);
44
+ if (_) return clearTimeout(p), p = setTimeout(C, t), y(m);
45
+ }
46
+ return p === void 0 && (p = setTimeout(C, t)), f;
47
+ }
48
+ return D.cancel = T, D.flush = E, D;
49
+ }
50
+ i.exports = d;
51
+ }));
52
+ export default require_debounce();
53
+ export { require_debounce };
@@ -0,0 +1,10 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.js";
2
+ var require_isObject = /* @__PURE__ */ __commonJSMin(((e, t) => {
3
+ function n(e) {
4
+ var t = typeof e;
5
+ return e != null && (t == "object" || t == "function");
6
+ }
7
+ t.exports = n;
8
+ }));
9
+ export default require_isObject();
10
+ export { require_isObject };
@@ -0,0 +1,9 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.js";
2
+ var require_isObjectLike = /* @__PURE__ */ __commonJSMin(((e, t) => {
3
+ function n(e) {
4
+ return typeof e == "object" && !!e;
5
+ }
6
+ t.exports = n;
7
+ }));
8
+ export default require_isObjectLike();
9
+ export { require_isObjectLike };
@@ -0,0 +1,12 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.js";
2
+ import { require__baseGetTag } from "./_baseGetTag.js";
3
+ import { require_isObjectLike } from "./isObjectLike.js";
4
+ var require_isSymbol = /* @__PURE__ */ __commonJSMin(((e, r) => {
5
+ var i = require__baseGetTag(), a = require_isObjectLike(), o = "[object Symbol]";
6
+ function s(e) {
7
+ return typeof e == "symbol" || a(e) && i(e) == o;
8
+ }
9
+ r.exports = s;
10
+ }));
11
+ export default require_isSymbol();
12
+ export { require_isSymbol };
@@ -0,0 +1,10 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.js";
2
+ import { require__root } from "./_root.js";
3
+ var require_now = /* @__PURE__ */ __commonJSMin(((e, n) => {
4
+ var r = require__root();
5
+ n.exports = function() {
6
+ return r.Date.now();
7
+ };
8
+ }));
9
+ export default require_now();
10
+ export { require_now };
@@ -0,0 +1,22 @@
1
+ import { __commonJSMin } from "../../_virtual/rolldown_runtime.js";
2
+ import { require_isObject } from "./isObject.js";
3
+ import { require__baseTrim } from "./_baseTrim.js";
4
+ import { require_isSymbol } from "./isSymbol.js";
5
+ var require_toNumber = /* @__PURE__ */ __commonJSMin(((e, i) => {
6
+ var a = require__baseTrim(), o = require_isObject(), s = require_isSymbol(), c = NaN, l = /^[-+]0x[0-9a-f]+$/i, u = /^0b[01]+$/i, d = /^0o[0-7]+$/i, f = parseInt;
7
+ function p(e) {
8
+ if (typeof e == "number") return e;
9
+ if (s(e)) return c;
10
+ if (o(e)) {
11
+ var n = typeof e.valueOf == "function" ? e.valueOf() : e;
12
+ e = o(n) ? n + "" : n;
13
+ }
14
+ if (typeof e != "string") return e === 0 ? e : +e;
15
+ e = a(e);
16
+ var r = u.test(e);
17
+ return r || d.test(e) ? f(e.slice(2), r ? 2 : 8) : l.test(e) ? c : +e;
18
+ }
19
+ i.exports = p;
20
+ }));
21
+ export default require_toNumber();
22
+ export { require_toNumber };
@@ -1,7 +1,7 @@
1
+ import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
1
2
  import ErrorSnackbar_default from "../components/snackbars/ErrorSnackbar.js";
2
3
  import LoadingCentered_default from "../components/LoadingCentered.js";
3
4
  import { usePipeline } from "../hooks/usePipelines.js";
4
- import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
5
5
  import WorkflowItem_default from "../features/workbench/WorkflowItem.js";
6
6
  import { requireParam } from "../lib/requireParam.js";
7
7
  import { c } from "react/compiler-runtime";
@@ -1,10 +1,10 @@
1
1
  import { useStudio } from "../providers/StudioProvider.js";
2
2
  import { useWorkspace } from "../hooks/useWorkspaces.js";
3
+ import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
3
4
  import MainLayout_default from "../components/layout/MainLayout.js";
4
5
  import ErrorSnackbar_default from "../components/snackbars/ErrorSnackbar.js";
5
6
  import { usePipeline, usePipelineConfig } from "../hooks/usePipelines.js";
6
7
  import { ReactFlowProvider } from "../node_modules/@xyflow/react/dist/esm/index.js";
7
- import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
8
8
  import { requireParam } from "../lib/requireParam.js";
9
9
  import PipelineDebugHeader_default from "../features/debug/components/PipelineDebugHeader.js";
10
10
  import PipelineFlowViewer_default from "../features/debug/components/PipelineFlowViewer.js";
@@ -0,0 +1,43 @@
1
+ import { __toESM } from "../_virtual/rolldown_runtime.js";
2
+ import { SseClientEvents } from "../events/sse-client-events.js";
3
+ import { eventBus } from "../services/eventEmitter.js";
4
+ import "../services/index.js";
5
+ import { useStudio } from "./StudioProvider.js";
6
+ import { require_debounce } from "../node_modules/lodash/debounce.js";
7
+ import { getDocumentsCacheKey } from "../hooks/useDocuments.js";
8
+ import { getNamespacesByPipelineCacheKey } from "../hooks/useNamespaces.js";
9
+ import { getWorkflowCacheKey, getWorkflowsByPipelineCacheKey, getWorkflowsCacheKey } from "../hooks/useWorkflows.js";
10
+ import { c } from "react/compiler-runtime";
11
+ import { useEffect, useRef } from "react";
12
+ import { useQueryClient } from "@tanstack/react-query";
13
+ var import_debounce = /* @__PURE__ */ __toESM(require_debounce(), 1), DEBOUNCE_MS = 300;
14
+ function createDebouncedInvalidator(e, u) {
15
+ return (0, import_debounce.default)(() => {
16
+ e.invalidateQueries({ queryKey: u });
17
+ }, DEBOUNCE_MS);
18
+ }
19
+ function InvalidationEventsProvider() {
20
+ let e = c(5), { environment: f } = useStudio(), _ = useQueryClient(), v;
21
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ new Map(), e[0] = v) : v = e[0];
22
+ let y = useRef(v), b, x;
23
+ return e[1] !== f.id || e[2] !== _ ? (b = () => {
24
+ if (!f.id) return;
25
+ let e = f.id, d = y.current, p = function(e) {
26
+ let u = JSON.stringify(e);
27
+ d.has(u) || d.set(u, createDebouncedInvalidator(_, e)), d.get(u)();
28
+ }, m = eventBus.on(SseClientEvents.WORKFLOW_CREATED, (u) => {
29
+ u.namespaceId && p(getWorkflowsCacheKey(e, u.namespaceId)), u.pipelineId && (p(getNamespacesByPipelineCacheKey(e, u.pipelineId)), p(getWorkflowsByPipelineCacheKey(e, u.pipelineId)));
30
+ }), h = eventBus.on(SseClientEvents.WORKFLOW_UPDATED, (u) => {
31
+ u.id && p(getWorkflowCacheKey(e, u.id)), u.namespaceId && p(getWorkflowsCacheKey(e, u.namespaceId)), u.pipelineId && (p(getNamespacesByPipelineCacheKey(e, u.pipelineId)), p(getWorkflowsByPipelineCacheKey(e, u.pipelineId)));
32
+ }), g = eventBus.on(SseClientEvents.DOCUMENT_CREATED, (u) => {
33
+ u.workflowId && p(getDocumentsCacheKey(e, u.workflowId));
34
+ });
35
+ return () => {
36
+ m(), h(), g(), d.forEach(_temp), d.clear();
37
+ };
38
+ }, x = [_, f.id], e[1] = f.id, e[2] = _, e[3] = b, e[4] = x) : (b = e[3], x = e[4]), useEffect(b, x), null;
39
+ }
40
+ function _temp(e) {
41
+ return e.cancel();
42
+ }
43
+ export { InvalidationEventsProvider };
@@ -0,0 +1,44 @@
1
+ import { eventBus } from "../services/eventEmitter.js";
2
+ import "../services/index.js";
3
+ import { useStudio } from "./StudioProvider.js";
4
+ import { useMe } from "../hooks/useAuth.js";
5
+ import { c } from "react/compiler-runtime";
6
+ import { useEffect, useRef } from "react";
7
+ function SseProvider() {
8
+ let s = c(5), { environment: l } = useStudio(), { data: u, isSuccess: d } = useMe(), f = useRef(null), p, m;
9
+ return s[0] !== l.url || s[1] !== d || s[2] !== u ? (p = () => {
10
+ if (l.url && d && u) {
11
+ f.current &&= (f.current.close(), null);
12
+ let a = `${l.url}/api/v1/sse/stream`, o = new EventSource(a, { withCredentials: !0 });
13
+ return f.current = o, o.onopen = _temp, o.onerror = () => {
14
+ o.readyState === EventSource.CLOSED && console.warn("SSE connection closed. Refresh the page if it does not recover.");
15
+ }, [
16
+ "workflow.created",
17
+ "workflow.updated",
18
+ "document.created",
19
+ "pipeline.updated",
20
+ "workspace.updated"
21
+ ].forEach((a) => {
22
+ o.addEventListener(a, (o) => {
23
+ try {
24
+ let a = JSON.parse(o.data);
25
+ eventBus.emit(a.type, a);
26
+ } catch (e) {
27
+ let o = e;
28
+ console.error(`Error parsing SSE event [${a}]:`, o);
29
+ }
30
+ });
31
+ }), () => {
32
+ o.close(), f.current = null;
33
+ };
34
+ }
35
+ }, m = [
36
+ l.url,
37
+ d,
38
+ u
39
+ ], s[0] = l.url, s[1] = d, s[2] = u, s[3] = p, s[4] = m) : (p = s[3], m = s[4]), useEffect(p, m), null;
40
+ }
41
+ function _temp() {
42
+ console.log("SSE connection established");
43
+ }
44
+ export { SseProvider };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loopstack/loopstack-studio",
3
- "version": "0.21.1",
3
+ "version": "0.21.3",
4
4
  "repository": "loopstack-ai/loopstack-studio",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "dependencies": {
27
27
  "@fontsource/roboto": "^5.2.10",
28
28
  "@hookform/resolvers": "^5.2.2",
29
- "@loopstack/api-client": "^0.20.0",
29
+ "@loopstack/api-client": "^0.20.1",
30
30
  "@loopstack/contracts": "^0.22.0",
31
31
  "@radix-ui/react-accordion": "^1.2.12",
32
32
  "@radix-ui/react-alert-dialog": "^1.1.15",