@loopstack/loopstack-studio 0.29.5 → 0.31.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 (122) hide show
  1. package/dist/_virtual/rolldown_runtime.js +3 -1
  2. package/dist/api/config.js +5 -4
  3. package/dist/api/environments.js +5 -1
  4. package/dist/api/processor.js +4 -1
  5. package/dist/app/EnvironmentEmbedRoot.js +22 -30
  6. package/dist/components/ai-elements/code-block.js +4 -4
  7. package/dist/components/dynamic-form/CodeContent.js +1 -1
  8. package/dist/components/dynamic-form/FormBody.js +1 -1
  9. package/dist/components/layout/StudioSidebar.js +116 -131
  10. package/dist/components/lists/ListView.js +46 -46
  11. package/dist/components/motion/FadeIn.js +72 -0
  12. package/dist/components/motion/StreamingText.js +49 -0
  13. package/dist/components/ui/accordion.js +2 -2
  14. package/dist/components/ui-widgets/UiWidget.js +11 -10
  15. package/dist/components/ui-widgets/widgets/AiPromptInput.js +31 -28
  16. package/dist/events/sse-client-events.js +7 -1
  17. package/dist/features/code-explorer/components/FileContentViewer.js +2 -2
  18. package/dist/features/dashboard/AppLauncher.js +84 -0
  19. package/dist/features/debug/components/WorkflowFlowViewer.js +49 -51
  20. package/dist/features/documents/DocumentRenderer.js +18 -17
  21. package/dist/features/documents/components/DocumentItem.js +42 -20
  22. package/dist/features/documents/components/DocumentList.js +34 -36
  23. package/dist/features/documents/components/DocumentMetadataPills.js +102 -49
  24. package/dist/features/documents/document-details/DocumentDetails.js +577 -377
  25. package/dist/features/documents/document-details/PromptDetails.js +118 -130
  26. package/dist/features/documents/document-details/document-debug-utils.js +100 -0
  27. package/dist/features/documents/renderers/ChoicesRenderer.js +41 -38
  28. package/dist/features/documents/renderers/ConfirmPromptRenderer.js +31 -28
  29. package/dist/features/documents/renderers/DocumentFormRenderer.js +62 -70
  30. package/dist/features/documents/renderers/LlmMessage.js +52 -47
  31. package/dist/features/documents/renderers/TextPromptRenderer.js +32 -29
  32. package/dist/features/documents/renderers/useDocumentTransition.js +4 -4
  33. package/dist/features/feature-registry/FeatureRegistryProvider.js +32 -10
  34. package/dist/features/feature-registry/available-features.js +12 -0
  35. package/dist/features/feature-registry/index.js +2 -1
  36. package/dist/features/file-explorer/components/FileExplorerPanel.js +55 -51
  37. package/dist/features/git/components/GitBranchBadge.js +31 -0
  38. package/dist/features/git/components/GitCommitList.js +46 -0
  39. package/dist/features/git/components/GitRemoteStatus.js +84 -0
  40. package/dist/features/git/components/WorkbenchGitPanel.js +81 -0
  41. package/dist/features/git/git-feature.js +12 -0
  42. package/dist/features/git/hooks/useGit.js +78 -0
  43. package/dist/features/git/index.js +1 -0
  44. package/dist/features/oauth/OAuthPromptRenderer.js +137 -142
  45. package/dist/features/runs/Runs.js +73 -73
  46. package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
  47. package/dist/features/secrets/renderers/SecretInputRenderer.js +30 -29
  48. package/dist/features/workbench/Workbench.js +25 -33
  49. package/dist/features/workbench/WorkflowItem.js +9 -9
  50. package/dist/features/workbench/WorkflowList.js +61 -62
  51. package/dist/features/workbench/components/NewRunDialog.js +237 -209
  52. package/dist/features/workbench/components/RecentRunItem.js +3 -3
  53. package/dist/features/workbench/components/WorkbenchEnvironmentPanel.js +8 -8
  54. package/dist/features/workbench/components/WorkbenchIconSidebar.js +74 -109
  55. package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
  56. package/dist/features/workbench/components/WorkflowForms.js +11 -10
  57. package/dist/features/workbench/components/WorkflowHistoryItem.js +16 -36
  58. package/dist/features/workbench/components/WorkflowHistoryList.js +19 -17
  59. package/dist/features/workbench/components/buttons/WorkflowButtons.js +3 -3
  60. package/dist/features/workbench/hooks/useLlmStreamingDocuments.js +159 -0
  61. package/dist/features/workbench/hooks/useWorkflowData.js +58 -31
  62. package/dist/features/workbench/index.js +2 -2
  63. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +53 -53
  64. package/dist/features/workspaces/Workspaces.js +166 -136
  65. package/dist/features/workspaces/components/CreateWorkspace.js +115 -107
  66. package/dist/features/workspaces/components/ExecutionTimeline.js +2 -2
  67. package/dist/features/workspaces/components/WorkflowRunForm.js +127 -104
  68. package/dist/features/workspaces/components/WorkspaceHomePage.js +6 -89
  69. package/dist/features/workspaces/components/workflow-form/ArgumentsView.js +1 -1
  70. package/dist/features/workspaces/components/workflow-form/SelectionView.js +15 -15
  71. package/dist/hooks/index.js +3 -2
  72. package/dist/hooks/query-keys.js +43 -30
  73. package/dist/hooks/useConfig.js +28 -22
  74. package/dist/hooks/useEnvironments.js +27 -2
  75. package/dist/hooks/useProcessor.js +14 -1
  76. package/dist/hooks/useWorkflows.js +4 -4
  77. package/dist/index.d.ts +119 -18
  78. package/dist/index.js +10 -9
  79. package/dist/node_modules/d3/src/index.js +13 -13
  80. package/dist/node_modules/d3-scale/src/continuous.js +16 -16
  81. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-3BPJPVTR.js +43 -43
  82. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-GPEHLZMM.js +270 -270
  83. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAUBKEIU.js +90 -90
  84. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-3OPIFGDE.js +458 -458
  85. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-55IACEB6.js +3 -3
  86. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5ZQYHXKU.js +37 -37
  87. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-727SXJPM.js +208 -208
  88. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-KSCS5N6A.js +145 -145
  89. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ND2GUHAM.js +7 -7
  90. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-O5CBEL6O.js +41 -41
  91. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-WU5MYG2G.js +3 -3
  92. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/cose-bilkent-S5V4N54A.js +6 -6
  93. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-KO2AKTUF.js +30 -30
  94. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-OG6HWLK6.js +82 -82
  95. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-TEJ5UH35.js +65 -65
  96. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-I6XJVG4X.js +227 -227
  97. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-6RSMTGT7.js +104 -104
  98. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-PVQCEYII.js +104 -104
  99. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-JHISSGLW.js +49 -49
  100. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-W4KKPZXB.js +101 -101
  101. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-5OEKKPKP.js +20 -20
  102. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-3UESZ5HK.js +354 -354
  103. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-AJRCARHV.js +53 -53
  104. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-PNZ67QCA.js +113 -113
  105. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-CIIHVFJN.js +90 -90
  106. package/dist/node_modules/mermaid/dist/mermaid.core.js +156 -156
  107. package/dist/node_modules/motion/dist/es/react.js +9 -2
  108. package/dist/pages/DashboardPage.js +20 -74
  109. package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
  110. package/dist/pages/DebugWorkflowsPage.js +76 -106
  111. package/dist/pages/EmbedWorkbenchPage.js +1 -1
  112. package/dist/pages/PreviewWorkbenchPage.js +6 -6
  113. package/dist/pages/WorkbenchPage.js +43 -47
  114. package/dist/pages/WorkflowDebugPage.js +6 -12
  115. package/dist/pages/WorkspacePage.js +40 -66
  116. package/dist/pages/WorkspaceRunsPage.js +24 -31
  117. package/dist/routing/LocalRouter.js +1 -1
  118. package/package.json +2 -2
  119. package/dist/features/dashboard/Dashboard.js +0 -125
  120. package/dist/features/dashboard/RunItem.js +0 -78
  121. package/dist/features/dashboard/RunList.js +0 -32
  122. package/dist/hooks/useDashboard.js +0 -16
@@ -1,93 +1,10 @@
1
- import { useStudio } from "../../../providers/StudioProvider.js";
2
- import { useCreateWorkflow } from "../../../hooks/useWorkflows.js";
3
- import { Button } from "../../../components/ui/button.js";
4
- import ErrorSnackbar_default from "../../../components/feedback/ErrorSnackbar.js";
5
- import Form_default from "../../../components/dynamic-form/Form.js";
6
- import { useRunWorkflow } from "../../../hooks/useProcessor.js";
1
+ import "../../../providers/StudioProvider.js";
2
+ import "../../../hooks/useWorkflows.js";
3
+ import "../../../components/ui/button.js";
4
+ import "../../../components/feedback/ErrorSnackbar.js";
5
+ import "../../../hooks/useProcessor.js";
6
+ import "../../../components/dynamic-form/Form.js";
7
7
  import { c } from "react/compiler-runtime";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { Loader2, Play } from "lucide-react";
10
10
  import { useForm } from "react-hook-form";
11
- var WorkspaceHomePage_default = (p) => {
12
- let m = c(39), { workspace: h, action: g } = p, { router: _ } = useStudio(), v = useCreateWorkflow(), y = useRunWorkflow(), b;
13
- m[0] === g.options ? b = m[1] : (b = g.options ?? {}, m[0] = g.options, m[1] = b);
14
- let x = b, S = x.workflow, C = x.title, w = x.subtitle, T = x.schema, E = x.workflowUi, D;
15
- m[2] === Symbol.for("react.memo_cache_sentinel") ? (D = {
16
- defaultValues: {},
17
- mode: "onChange"
18
- }, m[2] = D) : D = m[2];
19
- let O = useForm(D), k = v.isPending || y.isPending, A = !!T, j;
20
- m[3] !== v || m[4] !== A || m[5] !== _ || m[6] !== y || m[7] !== S || m[8] !== h ? (j = (t) => {
21
- v.mutate({ workflowCreateDto: {
22
- alias: S,
23
- title: null,
24
- workspaceId: h.id,
25
- transition: null,
26
- args: A ? t : void 0
27
- } }, { onSuccess: (t) => {
28
- y.mutate({
29
- workflowId: t.id,
30
- runWorkflowPayloadDto: {},
31
- force: !0
32
- }, { onSuccess: () => {
33
- _.navigateToWorkflow(t.id);
34
- } });
35
- } });
36
- }, m[3] = v, m[4] = A, m[5] = _, m[6] = y, m[7] = S, m[8] = h, m[9] = j) : j = m[9];
37
- let M = j, N;
38
- m[10] !== O || m[11] !== M ? (N = () => {
39
- O.handleSubmit(M)();
40
- }, m[10] = O, m[11] = M, m[12] = N) : N = m[12];
41
- let P = N, F;
42
- m[13] === v.error ? F = m[14] : (F = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: v.error }), m[13] = v.error, m[14] = F);
43
- let I;
44
- m[15] === y.error ? I = m[16] : (I = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: y.error }), m[15] = y.error, m[16] = I);
45
- let L;
46
- m[17] === C ? L = m[18] : (L = C && /* @__PURE__ */ jsx("h2", {
47
- className: "mb-2 text-center text-3xl font-bold tracking-tight",
48
- children: C
49
- }), m[17] = C, m[18] = L);
50
- let R;
51
- m[19] === w ? R = m[20] : (R = w && /* @__PURE__ */ jsx("p", {
52
- className: "text-muted-foreground mb-8 text-center text-sm",
53
- children: w
54
- }), m[19] = w, m[20] = R);
55
- let z;
56
- m[21] !== O || m[22] !== A || m[23] !== T || m[24] !== E ? (z = A ? /* @__PURE__ */ jsx("div", {
57
- className: "mb-6 w-full",
58
- children: /* @__PURE__ */ jsx(Form_default, {
59
- form: O,
60
- schema: T,
61
- ui: E,
62
- disabled: !1,
63
- viewOnly: !1
64
- })
65
- }) : null, m[21] = O, m[22] = A, m[23] = T, m[24] = E, m[25] = z) : z = m[25];
66
- let B;
67
- m[26] === k ? B = m[27] : (B = k ? /* @__PURE__ */ jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Play, { className: "mr-2 h-4 w-4" }), m[26] = k, m[27] = B);
68
- let V;
69
- m[28] !== k || m[29] !== P || m[30] !== B ? (V = /* @__PURE__ */ jsx("div", {
70
- className: "flex w-full justify-end",
71
- children: /* @__PURE__ */ jsxs(Button, {
72
- variant: "default",
73
- disabled: k,
74
- onClick: P,
75
- size: "lg",
76
- className: "font-medium",
77
- children: [B, "Run"]
78
- })
79
- }), m[28] = k, m[29] = P, m[30] = B, m[31] = V) : V = m[31];
80
- let H;
81
- return m[32] !== V || m[33] !== F || m[34] !== I || m[35] !== L || m[36] !== R || m[37] !== z ? (H = /* @__PURE__ */ jsxs("div", {
82
- className: "mx-auto flex min-h-[80vh] max-w-2xl flex-col items-center justify-center",
83
- children: [
84
- F,
85
- I,
86
- L,
87
- R,
88
- z,
89
- V
90
- ]
91
- }), m[32] = V, m[33] = F, m[34] = I, m[35] = L, m[36] = R, m[37] = z, m[38] = H) : H = m[38], H;
92
- };
93
- export { WorkspaceHomePage_default as default };
@@ -21,7 +21,7 @@ var ArgumentsView_default = (u) => {
21
21
  }, d[3] = v, d[4] = b, d[5] = x) : x = d[5];
22
22
  let S = x, C;
23
23
  d[6] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(Zap, { className: "h-5 w-5" }), d[6] = C) : C = d[6];
24
- let w = f?.title || f?.alias || "", T = f?.description, E;
24
+ let w = f?.title || f?.workflowName || "", T = f?.description, E;
25
25
  d[7] !== h || d[8] !== w || d[9] !== T ? (E = /* @__PURE__ */ jsx(HeaderSection_default, {
26
26
  icon: C,
27
27
  title: w,
@@ -6,9 +6,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Loader2, Play } from "lucide-react";
7
7
  var SelectionView_default = (p) => {
8
8
  let m = c(46), { title: h, workflowTypes: g, formData: _, errors: v, isLoading: y, onInputChange: b, onNext: x } = p, S;
9
- if (m[0] !== _.alias || m[1] !== g) {
9
+ if (m[0] !== _.workflowName || m[1] !== g) {
10
10
  let e;
11
- m[3] === _.alias ? e = m[4] : (e = (e) => e.alias === _.alias, m[3] = _.alias, m[4] = e), S = g.find(e), m[0] = _.alias, m[1] = g, m[2] = S;
11
+ m[3] === _.workflowName ? e = m[4] : (e = (e) => e.workflowName === _.workflowName, m[3] = _.workflowName, m[4] = e), S = g.find(e), m[0] = _.workflowName, m[1] = g, m[2] = S;
12
12
  } else S = m[2];
13
13
  let C = S, w;
14
14
  m[5] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ jsx(Play, { className: "h-5 w-5" }), m[5] = w) : w = m[5];
@@ -24,9 +24,9 @@ var SelectionView_default = (p) => {
24
24
  className: "text-foreground block text-sm font-medium",
25
25
  children: "Automation Type"
26
26
  }), m[8] = E) : E = m[8];
27
- let D = _.alias, O;
28
- m[9] === b ? O = m[10] : (O = (e) => b("alias", e), m[9] = b, m[10] = O);
29
- let k = `flex-1 ${v.alias ? "border-red-500 focus:ring-red-500" : ""}`, A;
27
+ let D = _.workflowName, O;
28
+ m[9] === b ? O = m[10] : (O = (e) => b("workflowName", e), m[9] = b, m[10] = O);
29
+ let k = `flex-1 ${v.workflowName ? "border-red-500 focus:ring-red-500" : ""}`, A;
30
30
  m[11] === Symbol.for("react.memo_cache_sentinel") ? (A = /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select an automation..." }), m[11] = A) : A = m[11];
31
31
  let j;
32
32
  m[12] === k ? j = m[13] : (j = /* @__PURE__ */ jsx(SelectTrigger, {
@@ -39,13 +39,13 @@ var SelectionView_default = (p) => {
39
39
  let N;
40
40
  m[16] === M ? N = m[17] : (N = /* @__PURE__ */ jsx(SelectContent, { children: M }), m[16] = M, m[17] = N);
41
41
  let P;
42
- m[18] !== _.alias || m[19] !== y || m[20] !== N || m[21] !== O || m[22] !== j ? (P = /* @__PURE__ */ jsxs(Select, {
42
+ m[18] !== _.workflowName || m[19] !== y || m[20] !== N || m[21] !== O || m[22] !== j ? (P = /* @__PURE__ */ jsxs(Select, {
43
43
  value: D,
44
44
  onValueChange: O,
45
45
  disabled: y,
46
46
  children: [j, N]
47
- }), m[18] = _.alias, m[19] = y, m[20] = N, m[21] = O, m[22] = j, m[23] = P) : P = m[23];
48
- let F = y || !_.alias, I;
47
+ }), m[18] = _.workflowName, m[19] = y, m[20] = N, m[21] = O, m[22] = j, m[23] = P) : P = m[23];
48
+ let F = y || !_.workflowName, I;
49
49
  m[24] === y ? I = m[25] : (I = y ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Play, { className: "h-4 w-4" }), m[24] = y, m[25] = I);
50
50
  let L;
51
51
  m[26] !== x || m[27] !== F || m[28] !== I ? (L = /* @__PURE__ */ jsx(Button, {
@@ -61,10 +61,10 @@ var SelectionView_default = (p) => {
61
61
  children: [P, L]
62
62
  }), m[30] = P, m[31] = L, m[32] = R) : R = m[32];
63
63
  let z;
64
- m[33] === v.alias ? z = m[34] : (z = v.alias && /* @__PURE__ */ jsx("p", {
64
+ m[33] === v.workflowName ? z = m[34] : (z = v.workflowName && /* @__PURE__ */ jsx("p", {
65
65
  className: "mt-1 flex items-center gap-1 text-sm text-red-500",
66
- children: v.alias
67
- }), m[33] = v.alias, m[34] = z);
66
+ children: v.workflowName
67
+ }), m[33] = v.workflowName, m[34] = z);
68
68
  let B;
69
69
  m[35] !== R || m[36] !== z ? (B = /* @__PURE__ */ jsxs("div", {
70
70
  className: "space-y-2",
@@ -79,7 +79,7 @@ var SelectionView_default = (p) => {
79
79
  className: "bg-muted/50 border-border mt-4 rounded-lg border p-4",
80
80
  children: [/* @__PURE__ */ jsx("h3", {
81
81
  className: "text-foreground mb-1 text-sm font-medium",
82
- children: C.title || C.alias
82
+ children: C.title || C.workflowName
83
83
  }), C.description && /* @__PURE__ */ jsx("p", {
84
84
  className: "text-muted-foreground text-sm leading-relaxed",
85
85
  children: C.description
@@ -98,8 +98,8 @@ var SelectionView_default = (p) => {
98
98
  };
99
99
  function _temp(e) {
100
100
  return /* @__PURE__ */ jsx(SelectItem, {
101
- value: e.alias,
102
- children: e.title ?? e.alias
103
- }, e.alias);
101
+ value: e.workflowName,
102
+ children: e.title ?? e.workflowName
103
+ }, e.workflowName);
104
104
  }
105
105
  export { SelectionView_default as default };
@@ -1,6 +1,7 @@
1
- import { getAppTypesCacheKey, getAvailableEnvironmentsCacheKey, getChildWorkflowsCacheKey, getDashboardStatsCacheKey, getDocumentCacheKey, getDocumentsCacheKey, getFileContentCacheKey, getFileTreeCacheKey, getGitLogCacheKey, getGitRemoteCacheKey, getGitStatusCacheKey, getHealthCacheKey, getMeCacheKey, getSecretsCacheKey, 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, getWorkflowTypesCacheKey, getWorkflowsCacheKey, getWorkspaceCacheKey, getWorkspacesCacheKey } from "./query-keys.js";
2
2
  import { useApiClient } from "./useApi.js";
3
3
  import { useIsMobile } from "./use-mobile.js";
4
- import { useAppConfig, useAvailableEnvironments, useWorkflowConfig } from "./useConfig.js";
4
+ import { useAppsConfig, useAvailableEnvironments, useDocumentConfigs } from "./useConfig.js";
5
+ import { useReplaceEnvironments, useResetEnvironment, useWorkspaceEnvironments } from "./useEnvironments.js";
5
6
  import { useBatchDeleteWorkflows, useChildWorkflows, useCreateWorkflow, useDeleteWorkflow, useFilterWorkflows, useUpdateWorkflow, useWorkflow, useWorkflowCheckpoints, useWorkflowConfigByName, useWorkflowSource } from "./useWorkflows.js";
6
7
  import { useBatchDeleteWorkspaces, useCreateWorkspace, useDeleteWorkspace, useFilterWorkspaces, useSetFavouriteWorkspace, useUpdateWorkspace, useWorkspace } from "./useWorkspaces.js";
@@ -7,13 +7,16 @@ function getHealthCacheKey(e) {
7
7
  function getAppTypesCacheKey(e) {
8
8
  return ["app-types", e];
9
9
  }
10
- function getWorkflowTypesCacheKey(e, y) {
10
+ function getWorkflowTypesCacheKey(e, S) {
11
11
  return [
12
12
  "workflowTypes",
13
13
  e,
14
- y
14
+ S
15
15
  ];
16
16
  }
17
+ function getStudioAppsCacheKey(e) {
18
+ return ["studio-apps", e];
19
+ }
17
20
  function getAvailableEnvironmentsCacheKey(e) {
18
21
  return ["available-environments", e];
19
22
  }
@@ -24,102 +27,112 @@ function getDashboardStatsCacheKey(e) {
24
27
  e
25
28
  ];
26
29
  }
27
- function getWorkflowCacheKey(e, y) {
30
+ function getWorkflowCacheKey(e, S) {
28
31
  return [
29
32
  "workflow",
30
33
  e,
31
- y
34
+ S
32
35
  ];
33
36
  }
34
37
  function getWorkflowsCacheKey(e) {
35
38
  return ["workflows", e];
36
39
  }
37
- function getChildWorkflowsCacheKey(e, y) {
40
+ function getChildWorkflowsCacheKey(e, S) {
38
41
  return [
39
42
  "childWorkflows",
40
43
  e,
41
- y
44
+ S
45
+ ];
46
+ }
47
+ function getToolConfigsCacheKey(e) {
48
+ return ["toolConfigs", e];
49
+ }
50
+ function getToolConfigCacheKey(e, S) {
51
+ return [
52
+ "toolConfig",
53
+ e,
54
+ S
42
55
  ];
43
56
  }
44
- function getWorkflowConfigCacheKey(e, y) {
57
+ function getWorkflowConfigCacheKey(e, S) {
45
58
  return [
46
59
  "workflowConfig",
47
60
  e,
48
- y
61
+ S
49
62
  ];
50
63
  }
51
- function getWorkflowSourceCacheKey(e, y) {
64
+ function getWorkflowSourceCacheKey(e, S) {
52
65
  return [
53
66
  "workflowSource",
54
67
  e,
55
- y
68
+ S
56
69
  ];
57
70
  }
58
- function getWorkspaceCacheKey(e, y) {
71
+ function getWorkspaceCacheKey(e, S) {
59
72
  return [
60
73
  "workspace",
61
74
  e,
62
- y
75
+ S
63
76
  ];
64
77
  }
65
78
  function getWorkspacesCacheKey(e) {
66
79
  return ["workspaces", e];
67
80
  }
68
- function getDocumentCacheKey(e, y) {
81
+ function getDocumentCacheKey(e, S) {
69
82
  return [
70
83
  "document",
71
84
  e,
72
- y
85
+ S
73
86
  ];
74
87
  }
75
- function getDocumentsCacheKey(e, y) {
88
+ function getDocumentsCacheKey(e, S) {
76
89
  return [
77
90
  "documents",
78
91
  e,
79
- y
92
+ S
80
93
  ];
81
94
  }
82
- function getSecretsCacheKey(e, y) {
95
+ function getSecretsCacheKey(e, S) {
83
96
  return [
84
97
  "secrets",
85
98
  e,
86
- y
99
+ S
87
100
  ];
88
101
  }
89
- function getGitStatusCacheKey(e, y) {
102
+ function getGitStatusCacheKey(e, S) {
90
103
  return [
91
104
  "gitStatus",
92
105
  e,
93
- y
106
+ S
94
107
  ];
95
108
  }
96
- function getGitLogCacheKey(e, y) {
109
+ function getGitLogCacheKey(e, S) {
97
110
  return [
98
111
  "gitLog",
99
112
  e,
100
- y
113
+ S
101
114
  ];
102
115
  }
103
- function getGitRemoteCacheKey(e, y) {
116
+ function getGitRemoteCacheKey(e, S) {
104
117
  return [
105
118
  "gitRemote",
106
119
  e,
107
- y
120
+ S
108
121
  ];
109
122
  }
110
- function getFileTreeCacheKey(e, y) {
123
+ function getFileTreeCacheKey(e, S) {
111
124
  return [
112
125
  "fileTree",
113
126
  e,
114
- y
127
+ S
115
128
  ];
116
129
  }
117
- function getFileContentCacheKey(e, y, b) {
130
+ function getFileContentCacheKey(e, S, C) {
118
131
  return [
119
132
  "fileContent",
120
133
  e,
121
- y,
122
- b
134
+ S,
135
+ C
123
136
  ];
124
137
  }
125
- export { getAppTypesCacheKey, getAvailableEnvironmentsCacheKey, getChildWorkflowsCacheKey, getDashboardStatsCacheKey, getDocumentCacheKey, getDocumentsCacheKey, getFileContentCacheKey, getFileTreeCacheKey, getGitLogCacheKey, getGitRemoteCacheKey, getGitStatusCacheKey, getHealthCacheKey, getMeCacheKey, getSecretsCacheKey, getWorkflowCacheKey, getWorkflowConfigCacheKey, getWorkflowSourceCacheKey, getWorkflowTypesCacheKey, getWorkflowsCacheKey, getWorkspaceCacheKey, getWorkspacesCacheKey };
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 };
@@ -1,40 +1,46 @@
1
- import { getAppTypesCacheKey, getAvailableEnvironmentsCacheKey, getWorkflowTypesCacheKey } from "./query-keys.js";
1
+ import { getAvailableEnvironmentsCacheKey, getStudioAppsCacheKey } from "./query-keys.js";
2
2
  import { useApiClient } from "./useApi.js";
3
3
  import { c } from "react/compiler-runtime";
4
+ import { useMemo } from "react";
4
5
  import { useQuery } from "@tanstack/react-query";
5
- function useAppConfig() {
6
- let i = c(7), { envKey: a, api: o } = useApiClient(), s;
7
- i[0] === a ? s = i[1] : (s = getAppTypesCacheKey(a), i[0] = a, i[1] = s);
6
+ function useAppsConfig() {
7
+ let e = c(7), { envKey: a, api: o } = useApiClient(), s;
8
+ e[0] === a ? s = e[1] : (s = getStudioAppsCacheKey(a), e[0] = a, e[1] = s);
8
9
  let l;
9
- i[2] === o ? l = i[3] : (l = () => o.config.getAppTypes(), i[2] = o, i[3] = l);
10
+ e[2] === o ? l = e[3] : (l = () => o.config.getApps(), e[2] = o, e[3] = l);
10
11
  let u;
11
- return i[4] !== s || i[5] !== l ? (u = {
12
+ return e[4] !== s || e[5] !== l ? (u = {
12
13
  queryKey: s,
13
14
  queryFn: l
14
- }, i[4] = s, i[5] = l, i[6] = u) : u = i[6], useQuery(u);
15
+ }, e[4] = s, e[5] = l, e[6] = u) : u = e[6], useQuery(u);
15
16
  }
16
- function useWorkflowConfig(e) {
17
- let i = c(10), { envKey: o, api: s } = useApiClient(), l;
18
- i[0] !== e || i[1] !== o ? (l = getWorkflowTypesCacheKey(o, e), i[0] = e, i[1] = o, i[2] = l) : l = i[2];
19
- let u;
20
- i[3] !== s || i[4] !== e ? (u = () => s.config.getWorkflowTypesByApp({ appBlockName: e }), i[3] = s, i[4] = e, i[5] = u) : u = i[5];
21
- let d = !!e, f;
22
- return i[6] !== l || i[7] !== u || i[8] !== d ? (f = {
23
- queryKey: l,
24
- queryFn: u,
25
- enabled: d
26
- }, i[6] = l, i[7] = u, i[8] = d, i[9] = f) : f = i[9], useQuery(f);
27
- }
28
- function useAvailableEnvironments(e) {
17
+ function useAvailableEnvironments(n) {
29
18
  let a = c(8), { envKey: o, api: s } = useApiClient(), l;
30
19
  a[0] === o ? l = a[1] : (l = getAvailableEnvironmentsCacheKey(o), a[0] = o, a[1] = l);
31
20
  let u;
32
21
  a[2] === s ? u = a[3] : (u = () => s.config.getAvailableEnvironments(), a[2] = s, a[3] = u);
33
- let d = e?.enabled ?? !0, f;
22
+ let d = n?.enabled ?? !0, f;
34
23
  return a[4] !== l || a[5] !== u || a[6] !== d ? (f = {
35
24
  queryKey: l,
36
25
  queryFn: u,
37
26
  enabled: d
38
27
  }, a[4] = l, a[5] = u, a[6] = d, a[7] = f) : f = a[7], useQuery(f);
39
28
  }
40
- export { useAppConfig, useAvailableEnvironments, useWorkflowConfig };
29
+ function useDocumentConfigs() {
30
+ let e = c(2), { data: n } = useAppsConfig(), r;
31
+ if (e[0] !== n) {
32
+ bb0: {
33
+ let e = /* @__PURE__ */ new Map();
34
+ if (!n?.length) {
35
+ r = e;
36
+ break bb0;
37
+ }
38
+ let i = n[0].documents ?? [];
39
+ for (let n of i) e.set(n.documentName, n);
40
+ r = e;
41
+ }
42
+ e[0] = n, e[1] = r;
43
+ } else r = e[1];
44
+ return r;
45
+ }
46
+ export { useAppsConfig, useAvailableEnvironments, useDocumentConfigs };
@@ -1,8 +1,33 @@
1
1
  import { useApiClient } from "./useApi.js";
2
2
  import { c } from "react/compiler-runtime";
3
- import { useMutation } from "@tanstack/react-query";
3
+ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
4
+ function useWorkspaceEnvironments(n) {
5
+ let i = c(9), { api: a } = useApiClient(), o;
6
+ i[0] === n ? o = i[1] : (o = ["workspace-environments", n], i[0] = n, i[1] = o);
7
+ let s;
8
+ i[2] !== a || i[3] !== n ? (s = () => a.environments.getByWorkspace(n), i[2] = a, i[3] = n, i[4] = s) : s = i[4];
9
+ let l = !!n, u;
10
+ return i[5] !== o || i[6] !== s || i[7] !== l ? (u = {
11
+ queryKey: o,
12
+ queryFn: s,
13
+ enabled: l
14
+ }, i[5] = o, i[6] = s, i[7] = l, i[8] = u) : u = i[8], useQuery(u);
15
+ }
16
+ function useReplaceEnvironments() {
17
+ let r = c(7), { api: a } = useApiClient(), o = useQueryClient(), s;
18
+ r[0] === a ? s = r[1] : (s = (e) => a.environments.replaceEnvironments(e.workspaceId, e.environments), r[0] = a, r[1] = s);
19
+ let l;
20
+ r[2] === o ? l = r[3] : (l = (e, t) => {
21
+ o.invalidateQueries({ queryKey: ["workspace-environments", t.workspaceId] });
22
+ }, r[2] = o, r[3] = l);
23
+ let u;
24
+ return r[4] !== s || r[5] !== l ? (u = {
25
+ mutationFn: s,
26
+ onSuccess: l
27
+ }, r[4] = s, r[5] = l, r[6] = u) : u = r[6], useMutation(u);
28
+ }
4
29
  function useResetEnvironment() {
5
30
  let r = c(2), { api: i } = useApiClient(), a;
6
31
  return r[0] === i ? a = r[1] : (a = { mutationFn: (e) => i.environments.resetEnvironment(e) }, r[0] = i, r[1] = a), useMutation(a);
7
32
  }
8
- export { useResetEnvironment };
33
+ export { useReplaceEnvironments, useResetEnvironment, useWorkspaceEnvironments };
@@ -15,4 +15,17 @@ function useRunWorkflow() {
15
15
  onSuccess: d
16
16
  }, a[5] = u, a[6] = d, a[7] = f) : f = a[7], useMutation(f);
17
17
  }
18
- export { useRunWorkflow };
18
+ function useStartWorkflow() {
19
+ let a = c(8), { envKey: o, api: s } = useApiClient(), l = useQueryClient(), u;
20
+ a[0] === s ? u = a[1] : (u = (e) => s.processor.startWorkflow(e), a[0] = s, a[1] = u);
21
+ let d;
22
+ a[2] !== o || a[3] !== l ? (d = () => {
23
+ l.invalidateQueries({ queryKey: getWorkflowsCacheKey(o) });
24
+ }, a[2] = o, a[3] = l, a[4] = d) : d = a[4];
25
+ let f;
26
+ return a[5] !== u || a[6] !== d ? (f = {
27
+ mutationFn: u,
28
+ onSuccess: d
29
+ }, a[5] = u, a[6] = d, a[7] = f) : f = a[7], useMutation(f);
30
+ }
31
+ export { useRunWorkflow, useStartWorkflow };
@@ -136,9 +136,9 @@ function _temp(e) {
136
136
  }
137
137
  function useWorkflowConfigByName(e) {
138
138
  let r = c(10), { envKey: a, api: o } = useApiClient(), s;
139
- r[0] !== e || r[1] !== a ? (s = getWorkflowConfigCacheKey(a, e), r[0] = e, r[1] = a, r[2] = s) : s = r[2];
139
+ r[0] !== a || r[1] !== e ? (s = getWorkflowConfigCacheKey(a, e), r[0] = a, r[1] = e, r[2] = s) : s = r[2];
140
140
  let u;
141
- r[3] !== e || r[4] !== o ? (u = () => o.config.getWorkflowConfig({ alias: e }), r[3] = e, r[4] = o, r[5] = u) : u = r[5];
141
+ r[3] !== o || r[4] !== e ? (u = () => o.config.getWorkflowConfig({ workflowName: e }), r[3] = o, r[4] = e, r[5] = u) : u = r[5];
142
142
  let d = !!e, f;
143
143
  return r[6] !== s || r[7] !== u || r[8] !== d ? (f = {
144
144
  queryKey: s,
@@ -148,9 +148,9 @@ function useWorkflowConfigByName(e) {
148
148
  }
149
149
  function useWorkflowSource(e) {
150
150
  let r = c(10), { envKey: i, api: o } = useApiClient(), s;
151
- r[0] !== e || r[1] !== i ? (s = getWorkflowSourceCacheKey(i, e), r[0] = e, r[1] = i, r[2] = s) : s = r[2];
151
+ r[0] !== i || r[1] !== e ? (s = getWorkflowSourceCacheKey(i, e), r[0] = i, r[1] = e, r[2] = s) : s = r[2];
152
152
  let u;
153
- r[3] !== e || r[4] !== o ? (u = () => o.config.getWorkflowSource({ alias: e }), r[3] = e, r[4] = o, r[5] = u) : u = r[5];
153
+ r[3] !== o || r[4] !== e ? (u = () => o.config.getWorkflowSource({ workflowName: e }), r[3] = o, r[4] = e, r[5] = u) : u = r[5];
154
154
  let d = !!e, f;
155
155
  return r[6] !== s || r[7] !== u || r[8] !== d ? (f = {
156
156
  queryKey: s,