@loopstack/loopstack-studio 0.32.0 → 0.34.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 (39) hide show
  1. package/dist/api/index.js +4 -1
  2. package/dist/api/workflows.js +1 -0
  3. package/dist/app/EnvironmentEmbedRoot.js +22 -24
  4. package/dist/components/loopstack-elements/link.js +64 -56
  5. package/dist/components/messages/CompletionMessagePaper.js +25 -29
  6. package/dist/events/sse-client-events.js +2 -0
  7. package/dist/features/dashboard/AppLauncher.js +111 -64
  8. package/dist/features/documents/DocumentRenderer.js +42 -42
  9. package/dist/features/documents/renderers/LinkMessageRenderer.js +10 -10
  10. package/dist/features/feature-registry/FeatureRegistryProvider.js +15 -17
  11. package/dist/features/feature-registry/available-features.js +3 -2
  12. package/dist/features/feature-registry/index.js +1 -1
  13. package/dist/features/file-explorer/api/files.js +8 -3
  14. package/dist/features/file-explorer/components/FileExplorerPanel.js +64 -43
  15. package/dist/features/file-explorer/file-explorer-feature.js +15 -7
  16. package/dist/features/file-explorer/hooks/useFileExplorer.js +31 -29
  17. package/dist/features/file-explorer/index.js +1 -1
  18. package/dist/features/file-explorer/providers/FileExplorerProvider.js +77 -77
  19. package/dist/features/git/components/WorkbenchGitPanel.js +1 -1
  20. package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
  21. package/dist/features/workbench/Workbench.js +16 -16
  22. package/dist/features/workbench/components/NewRunDialog.js +1 -1
  23. package/dist/features/workbench/components/WorkbenchIconSidebar.js +1 -1
  24. package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
  25. package/dist/features/workbench/index.js +1 -1
  26. package/dist/features/workspaces/Workspaces.js +1 -1
  27. package/dist/hooks/index.js +2 -2
  28. package/dist/hooks/query-keys.js +39 -32
  29. package/dist/hooks/useSecrets.js +9 -45
  30. package/dist/hooks/useWorkflows.js +73 -61
  31. package/dist/index.d.ts +39 -13
  32. package/dist/index.js +8 -8
  33. package/dist/loopstack-studio.css +1 -1
  34. package/dist/pages/EmbedWorkbenchPage.js +46 -40
  35. package/dist/pages/WorkbenchPage.js +50 -45
  36. package/dist/pages/WorkspacePage.js +39 -25
  37. package/dist/pages/WorkspaceRunsPage.js +34 -26
  38. package/dist/providers/InvalidationEventsProvider.js +22 -20
  39. package/package.json +2 -2
@@ -5,101 +5,101 @@ import { jsx } from "react/jsx-runtime";
5
5
  import { useQueryClient } from "@tanstack/react-query";
6
6
  var FileExplorerContext = createContext(null);
7
7
  function FileExplorerProvider(s) {
8
- let l = c(36), { workspaceId: u, enabled: d, children: f } = s, p = d === void 0 ? !0 : d, m = useQueryClient(), h;
9
- l[0] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ new Set(), l[0] = h) : h = l[0];
10
- let [g, _] = useState(h), v;
11
- l[1] === Symbol.for("react.memo_cache_sentinel") ? (v = [], l[1] = v) : v = l[1];
12
- let [y, b] = useState(v), [x, S] = useState(null), C = useFileTree(u, p), w = useFileContent(u, x?.type === "file" ? x.path : void 0, p), T;
13
- l[2] === Symbol.for("react.memo_cache_sentinel") ? (T = (e) => {
14
- _((a) => {
8
+ let l = c(36), { variant: u, workspaceId: d, enabled: f, children: p } = s, m = f === void 0 ? !0 : f, h = useQueryClient(), g;
9
+ l[0] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ new Set(), l[0] = g) : g = l[0];
10
+ let [_, v] = useState(g), y;
11
+ l[1] === Symbol.for("react.memo_cache_sentinel") ? (y = [], l[1] = y) : y = l[1];
12
+ let [b, x] = useState(y), [S, C] = useState(null), w = useFileTree(u, d, m), T = useFileContent(u, d, S?.type === "file" ? S.path : void 0, m), E;
13
+ l[2] === Symbol.for("react.memo_cache_sentinel") ? (E = (e) => {
14
+ v((a) => {
15
15
  let o = new Set(a);
16
16
  return o.has(e) ? o.delete(e) : o.add(e), o;
17
17
  });
18
- }, l[2] = T) : T = l[2];
19
- let E = T, D;
20
- l[3] === Symbol.for("react.memo_cache_sentinel") ? (D = (e) => {
21
- e.type === "file" && (S(e), b((a) => a.some((a) => a.path === e.path) ? a : [...a, e]));
22
- }, l[3] = D) : D = l[3];
23
- let O = D, k;
24
- l[4] === x?.path ? k = l[5] : (k = (e) => {
25
- b((a) => {
18
+ }, l[2] = E) : E = l[2];
19
+ let D = E, O;
20
+ l[3] === Symbol.for("react.memo_cache_sentinel") ? (O = (e) => {
21
+ e.type === "file" && (C(e), x((a) => a.some((a) => a.path === e.path) ? a : [...a, e]));
22
+ }, l[3] = O) : O = l[3];
23
+ let k = O, A;
24
+ l[4] === S?.path ? A = l[5] : (A = (e) => {
25
+ x((a) => {
26
26
  let o = a.filter((a) => a.path !== e.path);
27
- if (x?.path === e.path) if (o.length > 0) {
27
+ if (S?.path === e.path) if (o.length > 0) {
28
28
  let s = a.findIndex((a) => a.path === e.path);
29
- S(o[Math.max(0, s - 1)]);
30
- } else S(null);
29
+ C(o[Math.max(0, s - 1)]);
30
+ } else C(null);
31
31
  return o;
32
32
  });
33
- }, l[4] = x?.path, l[5] = k);
34
- let A = k, j;
35
- l[6] === x ? j = l[7] : (j = () => {
36
- x && b((e) => {
37
- let a = e.filter((e) => e.path !== x.path);
33
+ }, l[4] = S?.path, l[5] = A);
34
+ let j = A, M;
35
+ l[6] === S ? M = l[7] : (M = () => {
36
+ S && x((e) => {
37
+ let a = e.filter((e) => e.path !== S.path);
38
38
  if (a.length > 0) {
39
- let o = e.findIndex((e) => e.path === x.path);
40
- S(a[Math.max(0, o - 1)]);
41
- } else S(null);
39
+ let o = e.findIndex((e) => e.path === S.path);
40
+ C(a[Math.max(0, o - 1)]);
41
+ } else C(null);
42
42
  return a;
43
43
  });
44
- }, l[6] = x, l[7] = j);
45
- let M = j, N;
46
- l[8] === Symbol.for("react.memo_cache_sentinel") ? (N = () => {
47
- b([]), S(null);
48
- }, l[8] = N) : N = l[8];
49
- let P = N, F;
50
- l[9] === Symbol.for("react.memo_cache_sentinel") ? (F = (e) => {
51
- b([e]), S(e);
52
- }, l[9] = F) : F = l[9];
53
- let I = F, L;
54
- l[10] === x ? L = l[11] : (L = (e) => {
55
- b((a) => {
44
+ }, l[6] = S, l[7] = M);
45
+ let N = M, P;
46
+ l[8] === Symbol.for("react.memo_cache_sentinel") ? (P = () => {
47
+ x([]), C(null);
48
+ }, l[8] = P) : P = l[8];
49
+ let F = P, I;
50
+ l[9] === Symbol.for("react.memo_cache_sentinel") ? (I = (e) => {
51
+ x([e]), C(e);
52
+ }, l[9] = I) : I = l[9];
53
+ let L = I, R;
54
+ l[10] === S ? R = l[11] : (R = (e) => {
55
+ x((a) => {
56
56
  let o = a.findIndex((a) => a.path === e.path);
57
57
  if (o <= 0) return a;
58
58
  let s = a.slice(o);
59
- return x && a.findIndex((e) => e.path === x.path) < o && S(e), s;
59
+ return S && a.findIndex((e) => e.path === S.path) < o && C(e), s;
60
60
  });
61
- }, l[10] = x, l[11] = L);
62
- let R = L, z;
63
- l[12] === x ? z = l[13] : (z = (e) => {
64
- b((a) => {
61
+ }, l[10] = S, l[11] = R);
62
+ let z = R, B;
63
+ l[12] === S ? B = l[13] : (B = (e) => {
64
+ x((a) => {
65
65
  let o = a.findIndex((a) => a.path === e.path);
66
66
  if (o < 0 || o >= a.length - 1) return a;
67
67
  let s = a.slice(0, o + 1);
68
- return x && a.findIndex((e) => e.path === x.path) > o && S(e), s;
68
+ return S && a.findIndex((e) => e.path === S.path) > o && C(e), s;
69
69
  });
70
- }, l[12] = x, l[13] = z);
71
- let B = z, V;
72
- l[14] === m ? V = l[15] : (V = () => {
73
- m.invalidateQueries({ queryKey: ["file-explorer-tree"] });
74
- }, l[14] = m, l[15] = V);
75
- let H = V, U;
76
- l[16] === C.data ? U = l[17] : (U = C.data ?? [], l[16] = C.data, l[17] = U);
77
- let W = C.isLoading && !C.data, G = w.data?.content ?? null, K = w.isLoading && !!x, q;
78
- l[18] !== M || l[19] !== A || l[20] !== R || l[21] !== B || l[22] !== g || l[23] !== y || l[24] !== H || l[25] !== x || l[26] !== U || l[27] !== W || l[28] !== G || l[29] !== K || l[30] !== C.error || l[31] !== C.isFetching ? (q = {
79
- nodes: U,
80
- isTreeLoading: W,
81
- treeError: C.error,
82
- isFetchingTree: C.isFetching,
83
- openFiles: y,
84
- selectedFile: x,
85
- fileContent: G,
86
- isContentLoading: K,
87
- expandedFolders: g,
88
- toggleFolder: E,
89
- selectFile: O,
90
- closeFile: A,
91
- closeAll: P,
92
- closeOthers: I,
93
- closeToLeft: R,
94
- closeToRight: B,
95
- clearSelection: M,
96
- refreshTree: H
97
- }, l[18] = M, l[19] = A, l[20] = R, l[21] = B, l[22] = g, l[23] = y, l[24] = H, l[25] = x, l[26] = U, l[27] = W, l[28] = G, l[29] = K, l[30] = C.error, l[31] = C.isFetching, l[32] = q) : q = l[32];
98
- let J = q, Y;
99
- return l[33] !== f || l[34] !== J ? (Y = /* @__PURE__ */ jsx(FileExplorerContext.Provider, {
100
- value: J,
101
- children: f
102
- }), l[33] = f, l[34] = J, l[35] = Y) : Y = l[35], Y;
70
+ }, l[12] = S, l[13] = B);
71
+ let V = B, H;
72
+ l[14] === h ? H = l[15] : (H = () => {
73
+ h.invalidateQueries({ queryKey: ["file-explorer-tree"] });
74
+ }, l[14] = h, l[15] = H);
75
+ let U = H, W;
76
+ l[16] === w.data ? W = l[17] : (W = w.data ?? [], l[16] = w.data, l[17] = W);
77
+ let G = w.isLoading && !w.data, K = T.data?.content ?? null, q = T.isLoading && !!S, J;
78
+ l[18] !== N || l[19] !== j || l[20] !== z || l[21] !== V || l[22] !== _ || l[23] !== b || l[24] !== U || l[25] !== S || l[26] !== W || l[27] !== G || l[28] !== K || l[29] !== q || l[30] !== w.error || l[31] !== w.isFetching ? (J = {
79
+ nodes: W,
80
+ isTreeLoading: G,
81
+ treeError: w.error,
82
+ isFetchingTree: w.isFetching,
83
+ openFiles: b,
84
+ selectedFile: S,
85
+ fileContent: K,
86
+ isContentLoading: q,
87
+ expandedFolders: _,
88
+ toggleFolder: D,
89
+ selectFile: k,
90
+ closeFile: j,
91
+ closeAll: F,
92
+ closeOthers: L,
93
+ closeToLeft: z,
94
+ closeToRight: V,
95
+ clearSelection: N,
96
+ refreshTree: U
97
+ }, l[18] = N, l[19] = j, l[20] = z, l[21] = V, l[22] = _, l[23] = b, l[24] = U, l[25] = S, l[26] = W, l[27] = G, l[28] = K, l[29] = q, l[30] = w.error, l[31] = w.isFetching, l[32] = J) : J = l[32];
98
+ let Y = J, X;
99
+ return l[33] !== p || l[34] !== Y ? (X = /* @__PURE__ */ jsx(FileExplorerContext.Provider, {
100
+ value: Y,
101
+ children: p
102
+ }), l[33] = p, l[34] = Y, l[35] = X) : X = l[35], X;
103
103
  }
104
104
  function useFileExplorer() {
105
105
  let e = useContext(FileExplorerContext);
@@ -2,8 +2,8 @@ import { useStudio } from "../../../providers/StudioProvider.js";
2
2
  import { useCreateWorkflow } from "../../../hooks/useWorkflows.js";
3
3
  import { useRunWorkflow } from "../../../hooks/useProcessor.js";
4
4
  import { useWorkbenchLayout } from "../../workbench/providers/WorkbenchLayoutProvider.js";
5
- import "../../workbench/index.js";
6
5
  import { SidebarPanel } from "../../workbench/components/SidebarPanel.js";
6
+ import "../../workbench/index.js";
7
7
  import { useGitInvalidation, useGitLog, useGitRemote, useGitStatus, useRemoveGitRemote } from "../hooks/useGit.js";
8
8
  import { GitBranchBadge } from "./GitBranchBadge.js";
9
9
  import { GitCommitList } from "./GitCommitList.js";
@@ -2,8 +2,8 @@ import { Button } from "../../../components/ui/button.js";
2
2
  import { Input } from "../../../components/ui/input.js";
3
3
  import { Label } from "../../../components/ui/label.js";
4
4
  import { useWorkbenchLayout } from "../../workbench/providers/WorkbenchLayoutProvider.js";
5
- import "../../workbench/index.js";
6
5
  import { SidebarPanel } from "../../workbench/components/SidebarPanel.js";
6
+ import "../../workbench/index.js";
7
7
  import { useCreateSecret, useDeleteSecret, useUpdateSecret, useWorkspaceSecrets } from "../../../hooks/useSecrets.js";
8
8
  import { c } from "react/compiler-runtime";
9
9
  import { useState } from "react";
@@ -1,26 +1,26 @@
1
1
  import PageBreadcrumbs_default from "../../components/page/PageBreadcrumbs.js";
2
2
  import WorkflowList_default from "./WorkflowList.js";
3
- import { ScrollProvider } from "./providers/ScrollProvider.js";
4
3
  import { WorkbenchLayoutProvider } from "./providers/WorkbenchLayoutProvider.js";
5
4
  import { WorkbenchSidebarShell } from "./components/WorkbenchSidebarShell.js";
5
+ import { ScrollProvider } from "./providers/ScrollProvider.js";
6
6
  import { c } from "react/compiler-runtime";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
- function WorkbenchContent(a) {
9
- let o = c(7), { workflow: l, breadcrumbData: u } = a, d;
10
- o[0] === u ? d = o[1] : (d = /* @__PURE__ */ jsx("div", {
8
+ function WorkbenchContent(i) {
9
+ let a = c(7), { workflow: l, breadcrumbData: u } = i, d;
10
+ a[0] === u ? d = a[1] : (d = /* @__PURE__ */ jsx("div", {
11
11
  className: "border-b flex h-12 shrink-0 items-center",
12
12
  children: u ? /* @__PURE__ */ jsx(PageBreadcrumbs_default, { breadcrumbData: u }) : /* @__PURE__ */ jsx("span", {
13
13
  className: "px-3 text-sm font-medium",
14
14
  children: "Workflows"
15
15
  })
16
- }), o[0] = u, o[1] = d);
16
+ }), a[0] = u, a[1] = d);
17
17
  let f;
18
- o[2] === l ? f = o[3] : (f = /* @__PURE__ */ jsx(ScrollProvider, { children: /* @__PURE__ */ jsx("div", {
18
+ a[2] === l ? f = a[3] : (f = /* @__PURE__ */ jsx(ScrollProvider, { children: /* @__PURE__ */ jsx("div", {
19
19
  className: "flex-1 overflow-auto",
20
20
  children: /* @__PURE__ */ jsx(WorkflowList_default, { workflow: l })
21
- }) }), o[2] = l, o[3] = f);
21
+ }) }), a[2] = l, a[3] = f);
22
22
  let p;
23
- return o[4] !== d || o[5] !== f ? (p = /* @__PURE__ */ jsx("div", {
23
+ return a[4] !== d || a[5] !== f ? (p = /* @__PURE__ */ jsx("div", {
24
24
  className: "flex h-full flex-col",
25
25
  children: /* @__PURE__ */ jsx("div", {
26
26
  className: "flex flex-1 gap-4 overflow-hidden md:flex-row flex-col",
@@ -29,21 +29,21 @@ function WorkbenchContent(a) {
29
29
  children: [d, f]
30
30
  })
31
31
  })
32
- }), o[4] = d, o[5] = f, o[6] = p) : p = o[6], p;
32
+ }), a[4] = d, a[5] = f, a[6] = p) : p = a[6], p;
33
33
  }
34
34
  function Workbench(e) {
35
- let r = c(9), { workflow: i, breadcrumbData: s, getPreviewUrl: u, getEnvironmentPreviewUrl: d } = e, f = i?.workspaceId, p;
36
- r[0] !== s || r[1] !== i ? (p = /* @__PURE__ */ jsx(WorkbenchSidebarShell, { children: /* @__PURE__ */ jsx(WorkbenchContent, {
37
- workflow: i,
35
+ let r = c(9), { workflow: o, breadcrumbData: s, getPreviewUrl: u, getEnvironmentPreviewUrl: d } = e, f = o?.workspaceId, p;
36
+ r[0] !== s || r[1] !== o ? (p = /* @__PURE__ */ jsx(WorkbenchSidebarShell, { children: /* @__PURE__ */ jsx(WorkbenchContent, {
37
+ workflow: o,
38
38
  breadcrumbData: s
39
- }) }), r[0] = s, r[1] = i, r[2] = p) : p = r[2];
39
+ }) }), r[0] = s, r[1] = o, r[2] = p) : p = r[2];
40
40
  let m;
41
- return r[3] !== d || r[4] !== u || r[5] !== p || r[6] !== i || r[7] !== f ? (m = /* @__PURE__ */ jsx(WorkbenchLayoutProvider, {
41
+ return r[3] !== d || r[4] !== u || r[5] !== p || r[6] !== o || r[7] !== f ? (m = /* @__PURE__ */ jsx(WorkbenchLayoutProvider, {
42
42
  workspaceId: f,
43
- workflow: i,
43
+ workflow: o,
44
44
  getPreviewUrl: u,
45
45
  getEnvironmentPreviewUrl: d,
46
46
  children: p
47
- }), r[3] = d, r[4] = u, r[5] = p, r[6] = i, r[7] = f, r[8] = m) : m = r[8], m;
47
+ }), r[3] = d, r[4] = u, r[5] = p, r[6] = o, r[7] = f, r[8] = m) : m = r[8], m;
48
48
  }
49
49
  export { Workbench as default };
@@ -6,9 +6,9 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../../co
6
6
  import { Dialog, DialogContent, DialogTitle } from "../../../components/ui/dialog.js";
7
7
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../../components/ui/select.js";
8
8
  import ErrorSnackbar_default from "../../../components/feedback/ErrorSnackbar.js";
9
- import CreateWorkspace_default from "../../workspaces/components/CreateWorkspace.js";
10
9
  import { useStartWorkflow } from "../../../hooks/useProcessor.js";
11
10
  import Form_default from "../../../components/dynamic-form/Form.js";
11
+ import CreateWorkspace_default from "../../workspaces/components/CreateWorkspace.js";
12
12
  import "../../workspaces/index.js";
13
13
  import { c } from "react/compiler-runtime";
14
14
  import { useEffect, useMemo, useState } from "react";
@@ -1,8 +1,8 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
2
  import { Tooltip, TooltipContent, TooltipTrigger } from "../../../components/ui/tooltip.js";
3
- import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
4
3
  import { useFeatureRegistry } from "../../feature-registry/FeatureRegistryProvider.js";
5
4
  import "../../feature-registry/index.js";
5
+ import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
6
6
  import { c } from "react/compiler-runtime";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  import { MonitorPlay, Play, Server } from "lucide-react";
@@ -1,6 +1,6 @@
1
- import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
2
1
  import { useFeatureRegistry } from "../../feature-registry/FeatureRegistryProvider.js";
3
2
  import "../../feature-registry/index.js";
3
+ import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
4
4
  import { WorkbenchEnvironmentPanel } from "./WorkbenchEnvironmentPanel.js";
5
5
  import { WorkbenchIconSidebar } from "./WorkbenchIconSidebar.js";
6
6
  import { WorkbenchPreviewPanel } from "./WorkbenchPreviewPanel.js";
@@ -49,8 +49,8 @@ function ActivePanelContent() {
49
49
  }
50
50
  }
51
51
  }
52
- function SidebarContent(r) {
53
- let i = c(12), { children: o } = r, { activePanel: s, panelSize: p } = useWorkbenchLayout(), m = `${s ? CONTENT_WIDTH[p] : "w-full"} overflow-hidden`, h;
52
+ function SidebarContent(e) {
53
+ let i = c(12), { children: o } = e, { activePanel: s, panelSize: p } = useWorkbenchLayout(), m = `${s ? CONTENT_WIDTH[p] : "w-full"} overflow-hidden`, h;
54
54
  i[0] !== o || i[1] !== m ? (h = /* @__PURE__ */ jsx("div", {
55
55
  className: m,
56
56
  children: o
@@ -3,10 +3,10 @@ import WorkflowHistoryList_default from "./components/WorkflowHistoryList.js";
3
3
  import WorkflowButtons_default from "./components/buttons/WorkflowButtons.js";
4
4
  import WorkflowList_default from "./WorkflowList.js";
5
5
  import { useWorkbenchLayout } from "./providers/WorkbenchLayoutProvider.js";
6
+ import { WorkbenchSidebarShell } from "./components/WorkbenchSidebarShell.js";
6
7
  import Workbench from "./Workbench.js";
7
8
  import { NewRunDialog } from "./components/NewRunDialog.js";
8
9
  import "./hooks/useEmbedBridge.js";
9
10
  import "./components/PreviewWorkbench.js";
10
11
  import { RecentRunItem } from "./components/RecentRunItem.js";
11
12
  import "./components/PreviewEmptyState.js";
12
- import { WorkbenchSidebarShell } from "./components/WorkbenchSidebarShell.js";
@@ -6,8 +6,8 @@ import { Badge } from "../../components/ui/badge.js";
6
6
  import { Dialog, DialogContent } from "../../components/ui/dialog.js";
7
7
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../components/ui/tooltip.js";
8
8
  import ListView_default from "../../components/lists/ListView.js";
9
- import CreateWorkspace_default from "./components/CreateWorkspace.js";
10
9
  import { useDebounce } from "../../hooks/useDebounce.js";
10
+ import CreateWorkspace_default from "./components/CreateWorkspace.js";
11
11
  import { c } from "react/compiler-runtime";
12
12
  import { useEffect, useMemo, useState } from "react";
13
13
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -1,7 +1,7 @@
1
- import { getAppTypesCacheKey, getAvailableEnvironmentsCacheKey, getChildWorkflowsCacheKey, getDashboardStatsCacheKey, getDocumentCacheKey, getDocumentsCacheKey, getFileContentCacheKey, getFileTreeCacheKey, getGitLogCacheKey, getGitRemoteCacheKey, getGitStatusCacheKey, getHealthCacheKey, getMeCacheKey, getSecretsCacheKey, getStudioAppsCacheKey, getToolConfigCacheKey, getToolConfigsCacheKey, getWorkflowCacheKey, getWorkflowConfigCacheKey, getWorkflowSourceCacheKey, getWorkflowTypesCacheKey, getWorkflowsCacheKey, getWorkspaceCacheKey, getWorkspacesCacheKey } from "./query-keys.js";
1
+ import { getAppTypesCacheKey, getAvailableEnvironmentsCacheKey, getChildWorkflowsCacheKey, getDashboardStatsCacheKey, getDocumentCacheKey, getDocumentsCacheKey, getFileContentCacheKey, getFileTreeCacheKey, getGitLogCacheKey, getGitRemoteCacheKey, getGitStatusCacheKey, getHealthCacheKey, getMeCacheKey, getSecretsCacheKey, getStudioAppsCacheKey, getToolConfigCacheKey, getToolConfigsCacheKey, getWorkflowCacheKey, getWorkflowConfigCacheKey, getWorkflowSourceCacheKey, getWorkflowStatusCacheKey, getWorkflowTypesCacheKey, getWorkflowsCacheKey, getWorkspaceCacheKey, getWorkspacesCacheKey } from "./query-keys.js";
2
2
  import { useApiClient } from "./useApi.js";
3
3
  import { useIsMobile } from "./use-mobile.js";
4
4
  import { useAppsConfig, useAvailableEnvironments, useDocumentConfigs } from "./useConfig.js";
5
5
  import { useReplaceEnvironments, useResetEnvironment, useWorkspaceEnvironments } from "./useEnvironments.js";
6
- import { useBatchDeleteWorkflows, useChildWorkflows, useCreateWorkflow, useDeleteWorkflow, useFilterWorkflows, useUpdateWorkflow, useWorkflow, useWorkflowCheckpoints, useWorkflowConfigByName, useWorkflowSource } from "./useWorkflows.js";
6
+ import { useBatchDeleteWorkflows, useChildWorkflows, useCreateWorkflow, useDeleteWorkflow, useFilterWorkflows, useUpdateWorkflow, useWorkflow, useWorkflowCheckpoints, useWorkflowConfigByName, useWorkflowSource, useWorkflowStatus } from "./useWorkflows.js";
7
7
  import { useBatchDeleteWorkspaces, useCreateWorkspace, useDeleteWorkspace, useFilterWorkspaces, useSetFavouriteWorkspace, useUpdateWorkspace, useWorkspace } from "./useWorkspaces.js";
@@ -7,11 +7,11 @@ function getHealthCacheKey(e) {
7
7
  function getAppTypesCacheKey(e) {
8
8
  return ["app-types", e];
9
9
  }
10
- function getWorkflowTypesCacheKey(e, S) {
10
+ function getWorkflowTypesCacheKey(e, C) {
11
11
  return [
12
12
  "workflowTypes",
13
13
  e,
14
- S
14
+ C
15
15
  ];
16
16
  }
17
17
  function getStudioAppsCacheKey(e) {
@@ -27,112 +27,119 @@ function getDashboardStatsCacheKey(e) {
27
27
  e
28
28
  ];
29
29
  }
30
- function getWorkflowCacheKey(e, S) {
30
+ function getWorkflowCacheKey(e, C) {
31
31
  return [
32
32
  "workflow",
33
33
  e,
34
- S
34
+ C
35
+ ];
36
+ }
37
+ function getWorkflowStatusCacheKey(e, C) {
38
+ return [
39
+ "workflowStatus",
40
+ e,
41
+ C
35
42
  ];
36
43
  }
37
44
  function getWorkflowsCacheKey(e) {
38
45
  return ["workflows", e];
39
46
  }
40
- function getChildWorkflowsCacheKey(e, S) {
47
+ function getChildWorkflowsCacheKey(e, C) {
41
48
  return [
42
49
  "childWorkflows",
43
50
  e,
44
- S
51
+ C
45
52
  ];
46
53
  }
47
54
  function getToolConfigsCacheKey(e) {
48
55
  return ["toolConfigs", e];
49
56
  }
50
- function getToolConfigCacheKey(e, S) {
57
+ function getToolConfigCacheKey(e, C) {
51
58
  return [
52
59
  "toolConfig",
53
60
  e,
54
- S
61
+ C
55
62
  ];
56
63
  }
57
- function getWorkflowConfigCacheKey(e, S) {
64
+ function getWorkflowConfigCacheKey(e, C) {
58
65
  return [
59
66
  "workflowConfig",
60
67
  e,
61
- S
68
+ C
62
69
  ];
63
70
  }
64
- function getWorkflowSourceCacheKey(e, S) {
71
+ function getWorkflowSourceCacheKey(e, C) {
65
72
  return [
66
73
  "workflowSource",
67
74
  e,
68
- S
75
+ C
69
76
  ];
70
77
  }
71
- function getWorkspaceCacheKey(e, S) {
78
+ function getWorkspaceCacheKey(e, C) {
72
79
  return [
73
80
  "workspace",
74
81
  e,
75
- S
82
+ C
76
83
  ];
77
84
  }
78
85
  function getWorkspacesCacheKey(e) {
79
86
  return ["workspaces", e];
80
87
  }
81
- function getDocumentCacheKey(e, S) {
88
+ function getDocumentCacheKey(e, C) {
82
89
  return [
83
90
  "document",
84
91
  e,
85
- S
92
+ C
86
93
  ];
87
94
  }
88
- function getDocumentsCacheKey(e, S) {
95
+ function getDocumentsCacheKey(e, C) {
89
96
  return [
90
97
  "documents",
91
98
  e,
92
- S
99
+ C
93
100
  ];
94
101
  }
95
- function getSecretsCacheKey(e, S) {
102
+ function getSecretsCacheKey(e, C) {
96
103
  return [
97
104
  "secrets",
98
105
  e,
99
- S
106
+ C
100
107
  ];
101
108
  }
102
- function getGitStatusCacheKey(e, S) {
109
+ function getGitStatusCacheKey(e, C) {
103
110
  return [
104
111
  "gitStatus",
105
112
  e,
106
- S
113
+ C
107
114
  ];
108
115
  }
109
- function getGitLogCacheKey(e, S) {
116
+ function getGitLogCacheKey(e, C) {
110
117
  return [
111
118
  "gitLog",
112
119
  e,
113
- S
120
+ C
114
121
  ];
115
122
  }
116
- function getGitRemoteCacheKey(e, S) {
123
+ function getGitRemoteCacheKey(e, C) {
117
124
  return [
118
125
  "gitRemote",
119
126
  e,
120
- S
127
+ C
121
128
  ];
122
129
  }
123
- function getFileTreeCacheKey(e, S) {
130
+ function getFileTreeCacheKey(e, C) {
124
131
  return [
125
132
  "fileTree",
126
133
  e,
127
- S
134
+ C
128
135
  ];
129
136
  }
130
- function getFileContentCacheKey(e, S, C) {
137
+ function getFileContentCacheKey(e, C, w) {
131
138
  return [
132
139
  "fileContent",
133
140
  e,
134
- S,
135
- C
141
+ C,
142
+ w
136
143
  ];
137
144
  }
138
- export { getAppTypesCacheKey, getAvailableEnvironmentsCacheKey, getChildWorkflowsCacheKey, getDashboardStatsCacheKey, getDocumentCacheKey, getDocumentsCacheKey, getFileContentCacheKey, getFileTreeCacheKey, getGitLogCacheKey, getGitRemoteCacheKey, getGitStatusCacheKey, getHealthCacheKey, getMeCacheKey, getSecretsCacheKey, getStudioAppsCacheKey, getToolConfigCacheKey, getToolConfigsCacheKey, getWorkflowCacheKey, getWorkflowConfigCacheKey, getWorkflowSourceCacheKey, getWorkflowTypesCacheKey, getWorkflowsCacheKey, getWorkspaceCacheKey, getWorkspacesCacheKey };
145
+ export { getAppTypesCacheKey, getAvailableEnvironmentsCacheKey, getChildWorkflowsCacheKey, getDashboardStatsCacheKey, getDocumentCacheKey, getDocumentsCacheKey, getFileContentCacheKey, getFileTreeCacheKey, getGitLogCacheKey, getGitRemoteCacheKey, getGitStatusCacheKey, getHealthCacheKey, getMeCacheKey, getSecretsCacheKey, getStudioAppsCacheKey, getToolConfigCacheKey, getToolConfigsCacheKey, getWorkflowCacheKey, getWorkflowConfigCacheKey, getWorkflowSourceCacheKey, getWorkflowStatusCacheKey, getWorkflowTypesCacheKey, getWorkflowsCacheKey, getWorkspaceCacheKey, getWorkspacesCacheKey };
@@ -1,7 +1,7 @@
1
1
  import { getSecretsCacheKey } from "./query-keys.js";
2
2
  import { useApiClient } from "./useApi.js";
3
3
  import { c } from "react/compiler-runtime";
4
- import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
4
+ import { useMutation, useQuery } from "@tanstack/react-query";
5
5
  function useWorkspaceSecrets(r) {
6
6
  let a = c(10), { envKey: o, api: s } = useApiClient(), l;
7
7
  a[0] !== o || a[1] !== r ? (l = getSecretsCacheKey(o, r), a[0] = o, a[1] = r, a[2] = l) : l = a[2];
@@ -15,55 +15,19 @@ function useWorkspaceSecrets(r) {
15
15
  }, a[6] = l, a[7] = u, a[8] = d, a[9] = f) : f = a[9], useQuery(f);
16
16
  }
17
17
  function useCreateSecret() {
18
- let i = c(8), { envKey: o, api: s } = useApiClient(), l = useQueryClient(), u;
19
- i[0] === s ? u = i[1] : (u = (e) => s.secrets.create(e), i[0] = s, i[1] = u);
20
- let d;
21
- i[2] !== o || i[3] !== l ? (d = (t, n) => {
22
- l.invalidateQueries({ queryKey: getSecretsCacheKey(o, n.workspaceId) });
23
- }, i[2] = o, i[3] = l, i[4] = d) : d = i[4];
24
- let f;
25
- return i[5] !== u || i[6] !== d ? (f = {
26
- mutationFn: u,
27
- onSuccess: d
28
- }, i[5] = u, i[6] = d, i[7] = f) : f = i[7], useMutation(f);
18
+ let e = c(2), { api: i } = useApiClient(), a;
19
+ return e[0] === i ? a = e[1] : (a = { mutationFn: (e) => i.secrets.create(e) }, e[0] = i, e[1] = a), useMutation(a);
29
20
  }
30
21
  function useUpdateSecret() {
31
- let i = c(8), { envKey: o, api: s } = useApiClient(), l = useQueryClient(), u;
32
- i[0] === s ? u = i[1] : (u = (e) => s.secrets.update(e), i[0] = s, i[1] = u);
33
- let d;
34
- i[2] !== o || i[3] !== l ? (d = (t, n) => {
35
- l.invalidateQueries({ queryKey: getSecretsCacheKey(o, n.workspaceId) });
36
- }, i[2] = o, i[3] = l, i[4] = d) : d = i[4];
37
- let f;
38
- return i[5] !== u || i[6] !== d ? (f = {
39
- mutationFn: u,
40
- onSuccess: d
41
- }, i[5] = u, i[6] = d, i[7] = f) : f = i[7], useMutation(f);
22
+ let e = c(2), { api: i } = useApiClient(), a;
23
+ return e[0] === i ? a = e[1] : (a = { mutationFn: (e) => i.secrets.update(e) }, e[0] = i, e[1] = a), useMutation(a);
42
24
  }
43
25
  function useUpsertSecret() {
44
- let i = c(8), { envKey: o, api: s } = useApiClient(), l = useQueryClient(), u;
45
- i[0] === s ? u = i[1] : (u = (e) => s.secrets.upsert(e), i[0] = s, i[1] = u);
46
- let d;
47
- i[2] !== o || i[3] !== l ? (d = (t, n) => {
48
- l.invalidateQueries({ queryKey: getSecretsCacheKey(o, n.workspaceId) });
49
- }, i[2] = o, i[3] = l, i[4] = d) : d = i[4];
50
- let f;
51
- return i[5] !== u || i[6] !== d ? (f = {
52
- mutationFn: u,
53
- onSuccess: d
54
- }, i[5] = u, i[6] = d, i[7] = f) : f = i[7], useMutation(f);
26
+ let e = c(2), { api: i } = useApiClient(), a;
27
+ return e[0] === i ? a = e[1] : (a = { mutationFn: (e) => i.secrets.upsert(e) }, e[0] = i, e[1] = a), useMutation(a);
55
28
  }
56
29
  function useDeleteSecret() {
57
- let i = c(8), { envKey: o, api: s } = useApiClient(), l = useQueryClient(), u;
58
- i[0] === s ? u = i[1] : (u = (e) => s.secrets.delete(e), i[0] = s, i[1] = u);
59
- let d;
60
- i[2] !== o || i[3] !== l ? (d = (t, n) => {
61
- l.invalidateQueries({ queryKey: getSecretsCacheKey(o, n.workspaceId) });
62
- }, i[2] = o, i[3] = l, i[4] = d) : d = i[4];
63
- let f;
64
- return i[5] !== u || i[6] !== d ? (f = {
65
- mutationFn: u,
66
- onSuccess: d
67
- }, i[5] = u, i[6] = d, i[7] = f) : f = i[7], useMutation(f);
30
+ let e = c(2), { api: i } = useApiClient(), a;
31
+ return e[0] === i ? a = e[1] : (a = { mutationFn: (e) => i.secrets.delete(e) }, e[0] = i, e[1] = a), useMutation(a);
68
32
  }
69
33
  export { useCreateSecret, useDeleteSecret, useUpdateSecret, useUpsertSecret, useWorkspaceSecrets };