@loopstack/loopstack-studio 0.24.0 → 0.25.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 (105) hide show
  1. package/dist/api/config.js +3 -3
  2. package/dist/api/index.js +9 -13
  3. package/dist/api/processor.js +1 -1
  4. package/dist/api/workflows.js +7 -1
  5. package/dist/components/dynamic-form/CodeContent.js +3 -3
  6. package/dist/components/dynamic-form/fields/CodeViewField.js +36 -36
  7. package/dist/components/feedback/LoadingCentered.js +1 -1
  8. package/dist/components/layout/StudioSidebar.js +2 -2
  9. package/dist/components/loopstack-elements/link.js +77 -76
  10. package/dist/components/loopstack-elements/tool.js +171 -0
  11. package/dist/components/ui-widgets/UiActions.js +10 -4
  12. package/dist/components/ui-widgets/UiWidget.js +27 -36
  13. package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +8 -6
  14. package/dist/components/ui-widgets/widgets/SubmitButton.js +8 -6
  15. package/dist/features/code-explorer/components/FileContentViewer.js +87 -112
  16. package/dist/features/dashboard/RunItem.js +1 -1
  17. package/dist/features/debug/components/ConfigFlowViewer.js +2 -2
  18. package/dist/features/debug/components/{PipelineDebugHeader.js → WorkflowDebugHeader.js} +5 -5
  19. package/dist/features/debug/components/{PipelineDebugLegend.js → WorkflowDebugLegend.js} +2 -2
  20. package/dist/features/debug/components/{PipelineFlowViewer.js → WorkflowFlowViewer.js} +9 -9
  21. package/dist/features/debug/components/workflow-flow/WorkflowGraph.js +46 -0
  22. package/dist/features/debug/index.js +2 -2
  23. package/dist/features/debug/lib/flow-utils.js +142 -150
  24. package/dist/features/documents/DocumentRenderer.js +66 -30
  25. package/dist/features/documents/components/DocumentItem.js +2 -2
  26. package/dist/features/documents/components/DocumentList.js +15 -12
  27. package/dist/features/documents/document-details/DocumentDetails.js +4 -4
  28. package/dist/features/documents/renderers/AiMessage.js +1 -1
  29. package/dist/features/documents/renderers/ChoicesRenderer.js +92 -0
  30. package/dist/features/documents/renderers/ClaudeMessage.js +1 -1
  31. package/dist/features/documents/renderers/ConfirmPromptRenderer.js +56 -0
  32. package/dist/features/documents/renderers/DocumentFormRenderer.js +95 -71
  33. package/dist/features/documents/renderers/LinkMessageRenderer.js +8 -10
  34. package/dist/features/documents/renderers/SecretInputRenderer.js +87 -0
  35. package/dist/features/documents/renderers/TextPromptRenderer.js +57 -0
  36. package/dist/features/documents/renderers/useDocumentTransition.js +30 -0
  37. package/dist/features/oauth/OAuthPromptRenderer.js +20 -20
  38. package/dist/features/runs/Runs.js +8 -8
  39. package/dist/features/workbench/Workbench.js +35 -35
  40. package/dist/features/workbench/WorkflowItem.js +10 -9
  41. package/dist/features/workbench/WorkflowList.js +56 -73
  42. package/dist/features/workbench/components/NewRunDialog.js +18 -18
  43. package/dist/features/workbench/components/WorkbenchFilesPanel.js +1 -1
  44. package/dist/features/workbench/components/WorkbenchFloatingPanel.js +33 -72
  45. package/dist/features/workbench/components/WorkbenchFlowPanel.js +27 -29
  46. package/dist/features/workbench/components/WorkbenchIconSidebar.js +30 -42
  47. package/dist/features/workbench/components/WorkbenchPreviewPanel.js +2 -2
  48. package/dist/features/workbench/components/WorkbenchSecretsPanel.js +1 -1
  49. package/dist/features/workbench/components/WorkbenchSettingsModal.js +16 -41
  50. package/dist/features/workbench/components/WorkflowForms.js +14 -13
  51. package/dist/features/workbench/components/WorkflowHistoryItem.js +60 -81
  52. package/dist/features/workbench/components/{PipelineHistoryList.js → WorkflowHistoryList.js} +5 -5
  53. package/dist/features/workbench/components/buttons/WorkflowButtons.js +56 -54
  54. package/dist/features/workbench/hooks/useWorkflowData.js +10 -10
  55. package/dist/features/workbench/hooks/useWorkflowListState.js +8 -45
  56. package/dist/features/workbench/index.js +2 -3
  57. package/dist/features/workbench/providers/ScrollProvider.js +2 -2
  58. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +4 -4
  59. package/dist/features/workspaces/Workspaces.js +1 -1
  60. package/dist/features/workspaces/components/CreateWorkspace.js +12 -12
  61. package/dist/features/workspaces/components/ExecutionTimeline.js +22 -21
  62. package/dist/features/workspaces/components/{NewPipelineRunDialog.js → NewWorkflowRunDialog.js} +6 -6
  63. package/dist/features/workspaces/components/{PipelineForm.js → WorkflowRunForm.js} +31 -31
  64. package/dist/features/workspaces/components/WorkspaceHomePage.js +11 -11
  65. package/dist/features/workspaces/components/{pipeline-form → workflow-form}/ArgumentsView.js +1 -1
  66. package/dist/features/workspaces/components/{pipeline-form → workflow-form}/SelectionView.js +16 -16
  67. package/dist/hooks/index.js +3 -3
  68. package/dist/hooks/query-keys.js +31 -72
  69. package/dist/hooks/useConfig.js +5 -5
  70. package/dist/hooks/useProcessor.js +5 -5
  71. package/dist/hooks/useWorkflows.js +155 -68
  72. package/dist/index.d.ts +127 -128
  73. package/dist/index.js +5 -5
  74. package/dist/packages/contracts/dist/enums/index.js +11 -12
  75. package/dist/packages/contracts/dist/enums/workflow-state.enum.js +1 -1
  76. package/dist/pages/DebugWorkflowDetailsPage.js +8 -8
  77. package/dist/pages/DebugWorkflowsPage.js +10 -10
  78. package/dist/pages/EmbedWorkbenchPage.js +42 -52
  79. package/dist/pages/PreviewWorkbenchPage.js +130 -255
  80. package/dist/pages/RunsListPage.js +1 -1
  81. package/dist/pages/StudioLandingPage.js +13 -13
  82. package/dist/pages/WorkbenchPage.js +6 -6
  83. package/dist/pages/WorkflowDebugPage.js +114 -0
  84. package/dist/pages/WorkspacePage.js +4 -2
  85. package/dist/providers/InvalidationEventsProvider.js +19 -19
  86. package/dist/providers/SseProvider.js +0 -1
  87. package/dist/routing/LocalRouter.js +14 -17
  88. package/package.json +2 -2
  89. package/dist/api/namespaces.js +0 -7
  90. package/dist/api/pipelines.js +0 -13
  91. package/dist/components/ai-elements/tool.js +0 -158
  92. package/dist/components/ui-widgets/widgets/SecretInput.js +0 -42
  93. package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +0 -41
  94. package/dist/features/workbench/NavigationItems.js +0 -52
  95. package/dist/features/workbench/WorkbenchNavigation.js +0 -38
  96. package/dist/features/workbench/components/NavigationItem.js +0 -68
  97. package/dist/features/workbench/hooks/useIntersectionObserver.js +0 -44
  98. package/dist/hooks/useNamespaceTree.js +0 -27
  99. package/dist/hooks/useNamespaces.js +0 -25
  100. package/dist/hooks/usePipelines.js +0 -161
  101. package/dist/packages/contracts/dist/enums/pipeline-state.js +0 -10
  102. package/dist/pages/PipelineDebugPage.js +0 -115
  103. /package/dist/features/debug/components/{pipeline-flow → workflow-flow}/StateNode.js +0 -0
  104. /package/dist/features/debug/components/{pipeline-flow → workflow-flow}/WorkflowTransitionEdge.js +0 -0
  105. /package/dist/features/workspaces/components/{pipeline-form → workflow-form}/HeaderSection.js +0 -0
@@ -7,11 +7,11 @@ function getHealthCacheKey(e) {
7
7
  function getWorkspaceTypesCacheKey(e) {
8
8
  return ["workspace-types", e];
9
9
  }
10
- function getPipelineTypesCacheKey(e, S) {
10
+ function getWorkflowTypesCacheKey(e, g) {
11
11
  return [
12
- "pipeline-types",
12
+ "workflowTypes",
13
13
  e,
14
- S
14
+ g
15
15
  ];
16
16
  }
17
17
  function getAvailableEnvironmentsCacheKey(e) {
@@ -24,122 +24,81 @@ function getDashboardStatsCacheKey(e) {
24
24
  e
25
25
  ];
26
26
  }
27
- function getPipelineCacheKey(e, S) {
27
+ function getWorkflowCacheKey(e, g) {
28
28
  return [
29
- "pipeline",
29
+ "workflow",
30
30
  e,
31
- S
31
+ g
32
32
  ];
33
33
  }
34
- function getPipelinesCacheKey(e) {
35
- return ["pipelines", e];
34
+ function getWorkflowsCacheKey(e) {
35
+ return ["workflows", e];
36
36
  }
37
- function getPipelinesChildrenCacheKey(e, S) {
37
+ function getChildWorkflowsCacheKey(e, g) {
38
38
  return [
39
- "pipelines",
40
- "children",
39
+ "childWorkflows",
41
40
  e,
42
- S
41
+ g
43
42
  ];
44
43
  }
45
- function getPipelineConfigCacheKey(e, S, C) {
44
+ function getWorkflowConfigCacheKey(e, g) {
46
45
  return [
47
- "pipelineConfig",
46
+ "workflowConfig",
48
47
  e,
49
- S,
50
- C
48
+ g
51
49
  ];
52
50
  }
53
- function getPipelineSourceCacheKey(e, S, C) {
51
+ function getWorkflowSourceCacheKey(e, g) {
54
52
  return [
55
- "pipelineSource",
53
+ "workflowSource",
56
54
  e,
57
- S,
58
- C
55
+ g
59
56
  ];
60
57
  }
61
- function getWorkspaceCacheKey(e, S) {
58
+ function getWorkspaceCacheKey(e, g) {
62
59
  return [
63
60
  "workspace",
64
61
  e,
65
- S
62
+ g
66
63
  ];
67
64
  }
68
65
  function getWorkspacesCacheKey(e) {
69
66
  return ["workspaces", e];
70
67
  }
71
- function getWorkflowCacheKey(e, S) {
72
- return [
73
- "workflow",
74
- e,
75
- S
76
- ];
77
- }
78
- function getWorkflowsCacheKey(e, S) {
79
- return [
80
- "workflows",
81
- e,
82
- S
83
- ];
84
- }
85
- function getWorkflowsByPipelineCacheKey(e, S) {
86
- return [
87
- "workflows-by-pipeline",
88
- e,
89
- S
90
- ];
91
- }
92
- function getAllWorkflowsCacheKey(e) {
93
- return ["all-workflows", e];
94
- }
95
- function getNamespaceCacheKey(e, S) {
96
- return [
97
- "namespace",
98
- e,
99
- S
100
- ];
101
- }
102
- function getNamespacesByPipelineCacheKey(e, S) {
103
- return [
104
- "namespaces",
105
- e,
106
- S
107
- ];
108
- }
109
- function getDocumentCacheKey(e, S) {
68
+ function getDocumentCacheKey(e, g) {
110
69
  return [
111
70
  "document",
112
71
  e,
113
- S
72
+ g
114
73
  ];
115
74
  }
116
- function getDocumentsCacheKey(e, S) {
75
+ function getDocumentsCacheKey(e, g) {
117
76
  return [
118
77
  "documents",
119
78
  e,
120
- S
79
+ g
121
80
  ];
122
81
  }
123
- function getSecretsCacheKey(e, S) {
82
+ function getSecretsCacheKey(e, g) {
124
83
  return [
125
84
  "secrets",
126
85
  e,
127
- S
86
+ g
128
87
  ];
129
88
  }
130
- function getFileTreeCacheKey(e, S) {
89
+ function getFileTreeCacheKey(e, g) {
131
90
  return [
132
91
  "fileTree",
133
92
  e,
134
- S
93
+ g
135
94
  ];
136
95
  }
137
- function getFileContentCacheKey(e, S, C) {
96
+ function getFileContentCacheKey(e, g, _) {
138
97
  return [
139
98
  "fileContent",
140
99
  e,
141
- S,
142
- C
100
+ g,
101
+ _
143
102
  ];
144
103
  }
145
- export { getAllWorkflowsCacheKey, getAvailableEnvironmentsCacheKey, getDashboardStatsCacheKey, getDocumentCacheKey, getDocumentsCacheKey, getFileContentCacheKey, getFileTreeCacheKey, getHealthCacheKey, getMeCacheKey, getNamespaceCacheKey, getNamespacesByPipelineCacheKey, getPipelineCacheKey, getPipelineConfigCacheKey, getPipelineSourceCacheKey, getPipelineTypesCacheKey, getPipelinesCacheKey, getPipelinesChildrenCacheKey, getSecretsCacheKey, getWorkflowCacheKey, getWorkflowsByPipelineCacheKey, getWorkflowsCacheKey, getWorkspaceCacheKey, getWorkspaceTypesCacheKey, getWorkspacesCacheKey };
104
+ export { getAvailableEnvironmentsCacheKey, getChildWorkflowsCacheKey, getDashboardStatsCacheKey, getDocumentCacheKey, getDocumentsCacheKey, getFileContentCacheKey, getFileTreeCacheKey, getHealthCacheKey, getMeCacheKey, getSecretsCacheKey, getWorkflowCacheKey, getWorkflowConfigCacheKey, getWorkflowSourceCacheKey, getWorkflowTypesCacheKey, getWorkflowsCacheKey, getWorkspaceCacheKey, getWorkspaceTypesCacheKey, getWorkspacesCacheKey };
@@ -1,4 +1,4 @@
1
- import { getAvailableEnvironmentsCacheKey, getPipelineTypesCacheKey, getWorkspaceTypesCacheKey } from "./query-keys.js";
1
+ import { getAvailableEnvironmentsCacheKey, getWorkflowTypesCacheKey, getWorkspaceTypesCacheKey } from "./query-keys.js";
2
2
  import { useApiClient } from "./useApi.js";
3
3
  import { c } from "react/compiler-runtime";
4
4
  import { useQuery } from "@tanstack/react-query";
@@ -13,11 +13,11 @@ function useWorkspaceConfig() {
13
13
  queryFn: l
14
14
  }, e[4] = s, e[5] = l, e[6] = u) : u = e[6], useQuery(u);
15
15
  }
16
- function usePipelineConfig(e) {
16
+ function useWorkflowConfig(e) {
17
17
  let a = c(10), { envKey: o, api: s } = useApiClient(), l;
18
- a[0] !== o || a[1] !== e ? (l = getPipelineTypesCacheKey(o, e), a[0] = o, a[1] = e, a[2] = l) : l = a[2];
18
+ a[0] !== o || a[1] !== e ? (l = getWorkflowTypesCacheKey(o, e), a[0] = o, a[1] = e, a[2] = l) : l = a[2];
19
19
  let u;
20
- a[3] !== s || a[4] !== e ? (u = () => s.config.getPipelineTypesByWorkspace({ workspaceBlockName: e }), a[3] = s, a[4] = e, a[5] = u) : u = a[5];
20
+ a[3] !== s || a[4] !== e ? (u = () => s.config.getWorkflowTypesByWorkspace({ workspaceBlockName: e }), a[3] = s, a[4] = e, a[5] = u) : u = a[5];
21
21
  let d = !!e, f;
22
22
  return a[6] !== l || a[7] !== u || a[8] !== d ? (f = {
23
23
  queryKey: l,
@@ -37,4 +37,4 @@ function useAvailableEnvironments(i) {
37
37
  enabled: d
38
38
  }, a[4] = l, a[5] = u, a[6] = d, a[7] = f) : f = a[7], useQuery(f);
39
39
  }
40
- export { useAvailableEnvironments, usePipelineConfig, useWorkspaceConfig };
40
+ export { useAvailableEnvironments, useWorkflowConfig, useWorkspaceConfig };
@@ -1,13 +1,13 @@
1
- import { getPipelinesCacheKey } from "./query-keys.js";
1
+ import { getWorkflowsCacheKey } from "./query-keys.js";
2
2
  import { useApiClient } from "./useApi.js";
3
3
  import { c } from "react/compiler-runtime";
4
4
  import { useMutation, useQueryClient } from "@tanstack/react-query";
5
- function useRunPipeline() {
5
+ function useRunWorkflow() {
6
6
  let a = c(8), { envKey: o, api: s } = useApiClient(), l = useQueryClient(), u;
7
- a[0] === s ? u = a[1] : (u = (e) => s.processor.runPipeline(e), a[0] = s, a[1] = u);
7
+ a[0] === s ? u = a[1] : (u = (e) => s.processor.runWorkflow(e), a[0] = s, a[1] = u);
8
8
  let d;
9
9
  a[2] !== o || a[3] !== l ? (d = () => {
10
- l.invalidateQueries({ queryKey: getPipelinesCacheKey(o) });
10
+ l.invalidateQueries({ queryKey: getWorkflowsCacheKey(o) });
11
11
  }, a[2] = o, a[3] = l, a[4] = d) : d = a[4];
12
12
  let f;
13
13
  return a[5] !== u || a[6] !== d ? (f = {
@@ -15,4 +15,4 @@ function useRunPipeline() {
15
15
  onSuccess: d
16
16
  }, a[5] = u, a[6] = d, a[7] = f) : f = a[7], useMutation(f);
17
17
  }
18
- export { useRunPipeline };
18
+ export { useRunWorkflow };
@@ -1,84 +1,171 @@
1
- import { getWorkflowCacheKey, getWorkflowsByPipelineCacheKey, getWorkflowsCacheKey } from "./query-keys.js";
1
+ import { getChildWorkflowsCacheKey, getWorkflowCacheKey, getWorkflowConfigCacheKey, getWorkflowSourceCacheKey, getWorkflowsCacheKey } from "./query-keys.js";
2
2
  import { useApiClient } from "./useApi.js";
3
3
  import { c } from "react/compiler-runtime";
4
4
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
5
- function useWorkflow(t) {
6
- let n = c(10), { envKey: a, api: s } = useApiClient(), l;
7
- n[0] !== a || n[1] !== t ? (l = getWorkflowCacheKey(a, t), n[0] = a, n[1] = t, n[2] = l) : l = n[2];
5
+ function useWorkflow(e) {
6
+ let i = c(10), { envKey: a, api: o } = useApiClient(), s;
7
+ i[0] !== a || i[1] !== e ? (s = getWorkflowCacheKey(a, e), i[0] = a, i[1] = e, i[2] = s) : s = i[2];
8
8
  let u;
9
- n[3] !== s || n[4] !== t ? (u = () => s.workflows.getById({ id: t }), n[3] = s, n[4] = t, n[5] = u) : u = n[5];
10
- let d = !!t, f;
11
- return n[6] !== l || n[7] !== u || n[8] !== d ? (f = {
12
- queryKey: l,
9
+ i[3] !== o || i[4] !== e ? (u = () => o.workflows.getById({ id: e }), i[3] = o, i[4] = e, i[5] = u) : u = i[5];
10
+ let d = !!e, f;
11
+ return i[6] !== s || i[7] !== u || i[8] !== d ? (f = {
12
+ queryKey: s,
13
13
  queryFn: u,
14
14
  enabled: d
15
- }, n[6] = l, n[7] = u, n[8] = d, n[9] = f) : f = n[9], useQuery(f);
15
+ }, i[6] = s, i[7] = u, i[8] = d, i[9] = f) : f = i[9], useQuery(f);
16
16
  }
17
- function useFetchWorkflowsByPipeline(e) {
18
- let n = c(14), { envKey: a, api: s } = useApiClient(), l;
19
- n[0] === e ? l = n[1] : (l = JSON.stringify({ pipelineId: e }), n[0] = e, n[1] = l);
20
- let u;
21
- n[2] === Symbol.for("react.memo_cache_sentinel") ? (u = JSON.stringify([{
22
- field: "index",
23
- order: "ASC"
24
- }]), n[2] = u) : u = n[2];
17
+ function useFilterWorkflows(e, r, i, a, s, u) {
18
+ let d = c(30), f = i === void 0 ? "id" : i, p = a === void 0 ? "DESC" : a, m = s === void 0 ? 0 : s, h = u === void 0 ? 10 : u, { envKey: g, api: _ } = useApiClient(), v = Object.keys(r).length > 0, y;
19
+ d[0] !== r || d[1] !== v ? (y = v ? JSON.stringify(r) : void 0, d[0] = r, d[1] = v, d[2] = y) : y = d[2];
20
+ let b = y, x;
21
+ d[3] === b ? x = d[4] : (x = b && { filter: b }, d[3] = b, d[4] = x);
22
+ let S;
23
+ d[5] !== p || d[6] !== f ? (S = JSON.stringify([{
24
+ field: f,
25
+ order: p
26
+ }]), d[5] = p, d[6] = f, d[7] = S) : S = d[7];
27
+ let C;
28
+ d[8] === e ? C = d[9] : (C = e && {
29
+ search: e,
30
+ searchColumns: JSON.stringify(["title", "model"])
31
+ }, d[8] = e, d[9] = C);
32
+ let w;
33
+ d[10] !== h || d[11] !== m || d[12] !== x || d[13] !== S || d[14] !== C ? (w = {
34
+ ...x,
35
+ sortBy: S,
36
+ page: m,
37
+ limit: h,
38
+ ...C
39
+ }, d[10] = h, d[11] = m, d[12] = x, d[13] = S, d[14] = C, d[15] = w) : w = d[15];
40
+ let T = w, E;
41
+ d[16] !== g || d[17] !== b || d[18] !== h || d[19] !== p || d[20] !== m || d[21] !== e || d[22] !== f ? (E = [
42
+ ...getWorkflowsCacheKey(g),
43
+ "list",
44
+ e ?? "",
45
+ b ?? "",
46
+ f,
47
+ p,
48
+ m,
49
+ h
50
+ ], d[16] = g, d[17] = b, d[18] = h, d[19] = p, d[20] = m, d[21] = e, d[22] = f, d[23] = E) : E = d[23];
51
+ let D;
52
+ d[24] !== _ || d[25] !== T ? (D = () => _.workflows.getAll(T), d[24] = _, d[25] = T, d[26] = D) : D = d[26];
53
+ let O;
54
+ return d[27] !== D || d[28] !== E ? (O = {
55
+ queryKey: E,
56
+ queryFn: D
57
+ }, d[27] = D, d[28] = E, d[29] = O) : O = d[29], useQuery(O);
58
+ }
59
+ function useCreateWorkflow() {
60
+ let e = c(8), { envKey: r, api: i } = useApiClient(), a = useQueryClient(), l;
61
+ e[0] === i ? l = e[1] : (l = (e) => i.workflows.create(e), e[0] = i, e[1] = l);
62
+ let d;
63
+ e[2] !== r || e[3] !== a ? (d = () => {
64
+ a.invalidateQueries({ queryKey: getWorkflowsCacheKey(r) });
65
+ }, e[2] = r, e[3] = a, e[4] = d) : d = e[4];
66
+ let f;
67
+ return e[5] !== l || e[6] !== d ? (f = {
68
+ mutationFn: l,
69
+ onSuccess: d
70
+ }, e[5] = l, e[6] = d, e[7] = f) : f = e[7], useMutation(f);
71
+ }
72
+ function useUpdateWorkflow() {
73
+ let e = c(8), { envKey: i, api: a } = useApiClient(), l = useQueryClient(), d;
74
+ e[0] === a ? d = e[1] : (d = (e) => a.workflows.update(e), e[0] = a, e[1] = d);
75
+ let f;
76
+ e[2] !== i || e[3] !== l ? (f = (e, a) => {
77
+ l.invalidateQueries({ queryKey: getWorkflowCacheKey(i, a.id) }), l.invalidateQueries({ queryKey: getWorkflowsCacheKey(i) });
78
+ }, e[2] = i, e[3] = l, e[4] = f) : f = e[4];
79
+ let p;
80
+ return e[5] !== d || e[6] !== f ? (p = {
81
+ mutationFn: d,
82
+ onSuccess: f
83
+ }, e[5] = d, e[6] = f, e[7] = p) : p = e[7], useMutation(p);
84
+ }
85
+ function useDeleteWorkflow() {
86
+ let e = c(8), { envKey: i, api: a } = useApiClient(), l = useQueryClient(), d;
87
+ e[0] === a ? d = e[1] : (d = (e) => a.workflows.delete({ id: e }), e[0] = a, e[1] = d);
25
88
  let f;
26
- n[3] === l ? f = n[4] : (f = {
27
- filter: l,
28
- sortBy: u
29
- }, n[3] = l, n[4] = f);
30
- let p = f, m;
31
- n[5] !== a || n[6] !== e ? (m = getWorkflowsByPipelineCacheKey(a, e), n[5] = a, n[6] = e, n[7] = m) : m = n[7];
32
- let h;
33
- n[8] !== s || n[9] !== p ? (h = () => s.workflows.getAll(p), n[8] = s, n[9] = p, n[10] = h) : h = n[10];
34
- let g;
35
- return n[11] !== m || n[12] !== h ? (g = {
36
- queryKey: m,
37
- queryFn: h,
38
- select: _temp
39
- }, n[11] = m, n[12] = h, n[13] = g) : g = n[13], useQuery(g);
89
+ e[2] !== i || e[3] !== l ? (f = (e, a) => {
90
+ l.removeQueries({ queryKey: getWorkflowCacheKey(i, a) }), l.invalidateQueries({ queryKey: getWorkflowsCacheKey(i) });
91
+ }, e[2] = i, e[3] = l, e[4] = f) : f = e[4];
92
+ let p;
93
+ return e[5] !== d || e[6] !== f ? (p = {
94
+ mutationFn: d,
95
+ onSuccess: f
96
+ }, e[5] = d, e[6] = f, e[7] = p) : p = e[7], useMutation(p);
97
+ }
98
+ function useBatchDeleteWorkflows() {
99
+ let e = c(8), { envKey: r, api: i } = useApiClient(), a = useQueryClient(), l;
100
+ e[0] === i ? l = e[1] : (l = (e) => i.workflows.batchDelete({ ids: e }), e[0] = i, e[1] = l);
101
+ let d;
102
+ e[2] !== r || e[3] !== a ? (d = () => {
103
+ a.invalidateQueries({ queryKey: getWorkflowsCacheKey(r) });
104
+ }, e[2] = r, e[3] = a, e[4] = d) : d = e[4];
105
+ let f;
106
+ return e[5] !== l || e[6] !== d ? (f = {
107
+ mutationFn: l,
108
+ onSuccess: d
109
+ }, e[5] = l, e[6] = d, e[7] = f) : f = e[7], useMutation(f);
110
+ }
111
+ function useChildWorkflows(r, i) {
112
+ let a = c(10), o = i === void 0 ? !0 : i, { envKey: s, api: u } = useApiClient(), d;
113
+ a[0] !== s || a[1] !== r ? (d = getChildWorkflowsCacheKey(s, r), a[0] = s, a[1] = r, a[2] = d) : d = a[2];
114
+ let f;
115
+ a[3] !== u || a[4] !== r ? (f = () => u.workflows.getAll({
116
+ filter: JSON.stringify({ parentId: r }),
117
+ sortBy: JSON.stringify([{
118
+ field: "createdAt",
119
+ order: "ASC"
120
+ }]),
121
+ page: 0,
122
+ limit: 100
123
+ }), a[3] = u, a[4] = r, a[5] = f) : f = a[5];
124
+ let p = o && !!r, m;
125
+ return a[6] !== d || a[7] !== f || a[8] !== p ? (m = {
126
+ queryKey: d,
127
+ queryFn: f,
128
+ select: _temp,
129
+ enabled: p
130
+ }, a[6] = d, a[7] = f, a[8] = p, a[9] = m) : m = a[9], useQuery(m);
40
131
  }
41
132
  function _temp(e) {
42
133
  return e.data;
43
134
  }
44
- function useFetchWorkflowsByNamespace(e) {
45
- let t = c(14), { envKey: a, api: s } = useApiClient(), l;
46
- t[0] === e ? l = t[1] : (l = JSON.stringify({ namespaceId: e }), t[0] = e, t[1] = l);
135
+ function useWorkflowConfigByName(e) {
136
+ let r = c(10), { envKey: a, api: o } = useApiClient(), s;
137
+ r[0] !== e || r[1] !== a ? (s = getWorkflowConfigCacheKey(a, e), r[0] = e, r[1] = a, r[2] = s) : s = r[2];
47
138
  let u;
48
- t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = JSON.stringify([{
49
- field: "index",
50
- order: "ASC"
51
- }]), t[2] = u) : u = t[2];
52
- let d;
53
- t[3] === l ? d = t[4] : (d = {
54
- filter: l,
55
- sortBy: u
56
- }, t[3] = l, t[4] = d);
57
- let f = d, m;
58
- t[5] !== a || t[6] !== e ? (m = getWorkflowsCacheKey(a, e), t[5] = a, t[6] = e, t[7] = m) : m = t[7];
59
- let h;
60
- t[8] !== s || t[9] !== f ? (h = () => s.workflows.getAll(f), t[8] = s, t[9] = f, t[10] = h) : h = t[10];
61
- let g;
62
- return t[11] !== m || t[12] !== h ? (g = {
63
- queryKey: m,
64
- queryFn: h,
65
- select: _temp2
66
- }, t[11] = m, t[12] = h, t[13] = g) : g = t[13], useQuery(g);
139
+ r[3] !== e || r[4] !== o ? (u = () => o.config.getWorkflowConfig({ alias: e }), r[3] = e, r[4] = o, r[5] = u) : u = r[5];
140
+ let d = !!e, f;
141
+ return r[6] !== s || r[7] !== u || r[8] !== d ? (f = {
142
+ queryKey: s,
143
+ queryFn: u,
144
+ enabled: d
145
+ }, r[6] = s, r[7] = u, r[8] = d, r[9] = f) : f = r[9], useQuery(f);
67
146
  }
68
- function _temp2(e) {
69
- return e.data;
147
+ function useWorkflowSource(e) {
148
+ let r = c(10), { envKey: i, api: o } = useApiClient(), s;
149
+ r[0] !== e || r[1] !== i ? (s = getWorkflowSourceCacheKey(i, e), r[0] = e, r[1] = i, r[2] = s) : s = r[2];
150
+ let u;
151
+ r[3] !== e || r[4] !== o ? (u = () => o.config.getWorkflowSource({ alias: e }), r[3] = e, r[4] = o, r[5] = u) : u = r[5];
152
+ let d = !!e, f;
153
+ return r[6] !== s || r[7] !== u || r[8] !== d ? (f = {
154
+ queryKey: s,
155
+ queryFn: u,
156
+ enabled: d
157
+ }, r[6] = s, r[7] = u, r[8] = d, r[9] = f) : f = r[9], useQuery(f);
70
158
  }
71
- function useDeleteWorkflow() {
72
- let o = c(8), { envKey: l, api: u } = useApiClient(), d = useQueryClient(), f;
73
- o[0] === u ? f = o[1] : (f = (e) => u.workflows.delete({ id: e.id }), o[0] = u, o[1] = f);
74
- let p;
75
- o[2] !== l || o[3] !== d ? (p = (r, i) => {
76
- d.removeQueries({ queryKey: getWorkflowCacheKey(l, i.id) }), d.invalidateQueries({ queryKey: getWorkflowsCacheKey(l, i.namespaceId) }), d.invalidateQueries({ queryKey: getWorkflowsByPipelineCacheKey(l, i.pipelineId) });
77
- }, o[2] = l, o[3] = d, o[4] = p) : p = o[4];
78
- let m;
79
- return o[5] !== f || o[6] !== p ? (m = {
80
- mutationFn: f,
81
- onSuccess: p
82
- }, o[5] = f, o[6] = p, o[7] = m) : m = o[7], useMutation(m);
159
+ function useWorkflowCheckpoints(e) {
160
+ let i = c(10), { envKey: a, api: o } = useApiClient(), s;
161
+ i[0] !== a || i[1] !== e ? (s = [...getWorkflowCacheKey(a, e), "checkpoints"], i[0] = a, i[1] = e, i[2] = s) : s = i[2];
162
+ let u;
163
+ i[3] !== o || i[4] !== e ? (u = () => o.workflows.getCheckpoints({ id: e }), i[3] = o, i[4] = e, i[5] = u) : u = i[5];
164
+ let d = !!e, f;
165
+ return i[6] !== s || i[7] !== u || i[8] !== d ? (f = {
166
+ queryKey: s,
167
+ queryFn: u,
168
+ enabled: d
169
+ }, i[6] = s, i[7] = u, i[8] = d, i[9] = f) : f = i[9], useQuery(f);
83
170
  }
84
- export { useDeleteWorkflow, useFetchWorkflowsByNamespace, useFetchWorkflowsByPipeline, useWorkflow };
171
+ export { useBatchDeleteWorkflows, useChildWorkflows, useCreateWorkflow, useDeleteWorkflow, useFilterWorkflows, useUpdateWorkflow, useWorkflow, useWorkflowCheckpoints, useWorkflowConfigByName, useWorkflowSource };