@loopstack/loopstack-studio 0.22.0 → 0.23.1

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 (98) hide show
  1. package/dist/app/EnvironmentEmbedRoot.js +20 -18
  2. package/dist/components/dynamic-form/Form.js +50 -27
  3. package/dist/components/dynamic-form/InputController.js +3 -1
  4. package/dist/components/dynamic-form/fields/MarkdownViewField.js +20 -0
  5. package/dist/components/feedback/ErrorBoundary.js +43 -0
  6. package/dist/components/{LoadingCentered.js → feedback/LoadingCentered.js} +1 -1
  7. package/dist/components/feedback/index.js +5 -0
  8. package/dist/components/index.js +6 -3
  9. package/dist/components/layout/MainLayout.js +32 -16
  10. package/dist/components/layout/StudioSidebar.js +165 -0
  11. package/dist/components/ui-widgets/widgets/SandboxRun.js +1 -0
  12. package/dist/features/code-explorer/CodeExplorer.js +6 -0
  13. package/dist/features/code-explorer/components/CodeExplorerTree.js +5 -0
  14. package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +82 -0
  15. package/dist/features/code-explorer/components/FileContentViewer.js +1 -0
  16. package/dist/features/code-explorer/components/FileTabsBar.js +3 -190
  17. package/dist/features/code-explorer/components/FileTabsBarBase.js +190 -0
  18. package/dist/features/code-explorer/index.js +4 -0
  19. package/dist/features/code-explorer/providers/CodeExplorerProvider.js +2 -162
  20. package/dist/features/code-explorer/utils/fileIcons.js +7 -4
  21. package/dist/features/debug/components/ConfigFlowViewer.js +1 -1
  22. package/dist/features/debug/components/PipelineFlowViewer.js +47 -46
  23. package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +19 -19
  24. package/dist/features/debug/index.js +3 -0
  25. package/dist/features/documents/DocumentRenderer.js +58 -0
  26. package/dist/features/{workbench → documents}/components/DocumentItem.js +1 -1
  27. package/dist/features/{workbench → documents}/components/DocumentMetadataPills.js +2 -2
  28. package/dist/features/{workbench/components → documents}/document-details/DocumentDetails.js +3 -3
  29. package/dist/features/{workbench/components → documents}/document-details/PromptDetails.js +3 -3
  30. package/dist/features/documents/index.js +4 -0
  31. package/dist/features/{workbench/components/document-renderer → documents/renderers}/AiMessage.js +5 -5
  32. package/dist/features/documents/renderers/ClaudeMessage.js +96 -0
  33. package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentDebugRenderer.js +1 -1
  34. package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentFormRenderer.js +3 -3
  35. package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentMessageRenderer.js +1 -1
  36. package/dist/features/{workbench/components/document-renderer → documents/renderers}/ErrorMessageRenderer.js +1 -1
  37. package/dist/features/{workbench/components/document-renderer → documents/renderers}/LinkMessageRenderer.js +1 -1
  38. package/dist/features/{workbench/components/document-renderer → documents/renderers}/MarkdownMessageRenderer.js +2 -2
  39. package/dist/features/{workbench/components/document-renderer → documents/renderers}/PlainMessageRenderer.js +1 -1
  40. package/dist/features/health/index.js +1 -0
  41. package/dist/features/workbench/NavigationItems.js +29 -29
  42. package/dist/features/workbench/Workbench.js +71 -99
  43. package/dist/features/workbench/WorkflowItem.js +63 -55
  44. package/dist/features/workbench/WorkflowList.js +52 -81
  45. package/dist/features/workbench/components/NewRunDialog.js +2 -1
  46. package/dist/features/workbench/components/RemoteFileTabsBar.js +18 -0
  47. package/dist/features/workbench/components/RemoteFileTree.js +90 -0
  48. package/dist/features/workbench/components/WorkbenchFilesPanel.js +60 -0
  49. package/dist/features/workbench/components/WorkbenchFlowPanel.js +4 -3
  50. package/dist/features/workbench/components/WorkbenchIconSidebar.js +37 -29
  51. package/dist/features/workbench/components/WorkflowHistoryItem.js +11 -11
  52. package/dist/features/workbench/components/buttons/WorkflowButtons.js +49 -50
  53. package/dist/features/workbench/hooks/useWorkflowData.js +49 -0
  54. package/dist/features/workbench/hooks/useWorkflowListState.js +50 -0
  55. package/dist/features/workbench/index.js +8 -0
  56. package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +145 -0
  57. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +47 -45
  58. package/dist/features/workspaces/components/CreateWorkspace.js +1 -1
  59. package/dist/features/workspaces/components/ExecutionTimeline.js +1 -1
  60. package/dist/features/workspaces/components/PipelineForm.js +2 -2
  61. package/dist/features/workspaces/components/WorkspaceHomePage.js +93 -0
  62. package/dist/features/workspaces/index.js +3 -0
  63. package/dist/hooks/index.js +3 -2
  64. package/dist/hooks/query-keys.js +138 -0
  65. package/dist/hooks/useAuth.js +43 -42
  66. package/dist/hooks/useConfig.js +31 -35
  67. package/dist/hooks/useDashboard.js +9 -13
  68. package/dist/hooks/useDebounce.js +8 -17
  69. package/dist/hooks/useDocuments.js +4 -9
  70. package/dist/hooks/useFiles.js +1 -51
  71. package/dist/hooks/useNamespaces.js +2 -8
  72. package/dist/hooks/usePipelines.js +132 -155
  73. package/dist/hooks/useProcessor.js +11 -14
  74. package/dist/hooks/useWorkflows.js +40 -62
  75. package/dist/hooks/useWorkspaces.js +105 -110
  76. package/dist/index.d.ts +105 -3
  77. package/dist/index.js +15 -7
  78. package/dist/node_modules/@xyflow/react/dist/esm/index.js +1 -1
  79. package/dist/pages/DashboardPage.js +1 -1
  80. package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
  81. package/dist/pages/EmbedWorkbenchPage.js +4 -3
  82. package/dist/pages/PipelineDebugPage.js +6 -5
  83. package/dist/pages/PreviewWorkbenchPage.js +228 -128
  84. package/dist/pages/RunsListPage.js +52 -24
  85. package/dist/pages/StudioLandingPage.js +1 -0
  86. package/dist/pages/WorkbenchPage.js +3 -2
  87. package/dist/pages/WorkspacePage.js +103 -51
  88. package/dist/pages/WorkspaceRunsPage.js +71 -0
  89. package/dist/providers/InvalidationEventsProvider.js +9 -11
  90. package/dist/providers/StudioProvider.js +2 -2
  91. package/dist/routing/LocalRouter.js +18 -8
  92. package/package.json +2 -2
  93. package/dist/features/workbench/components/DocumentRenderer.js +0 -54
  94. /package/dist/components/{content → feedback}/ErrorAlert.js +0 -0
  95. /package/dist/components/{snackbars → feedback}/ErrorSnackbar.js +0 -0
  96. /package/dist/components/{snackbars → feedback}/Snackbar.js +0 -0
  97. /package/dist/features/{workbench → documents}/components/DocumentList.js +0 -0
  98. /package/dist/features/{workbench/components/document-renderer → documents/renderers}/AiMessageContent.js +0 -0
@@ -1,106 +1,84 @@
1
+ import { getWorkflowCacheKey, getWorkflowsByPipelineCacheKey, getWorkflowsCacheKey } from "./query-keys.js";
1
2
  import { useApiClient } from "./useApi.js";
2
3
  import { c } from "react/compiler-runtime";
3
4
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
4
- function getWorkflowsCacheKey(e, t) {
5
- return [
6
- "workflows",
7
- e,
8
- t
9
- ];
10
- }
11
- function getWorkflowCacheKey(e, t) {
12
- return [
13
- "workflow",
14
- e,
15
- t
16
- ];
17
- }
18
- function getWorkflowsByPipelineCacheKey(e, t) {
19
- return [
20
- "workflows-by-pipeline",
21
- e,
22
- t
23
- ];
24
- }
25
- function useWorkflow(n) {
26
- let i = c(10), { envKey: a, api: s } = useApiClient(), l;
27
- i[0] !== a || i[1] !== n ? (l = getWorkflowCacheKey(a, n), i[0] = a, i[1] = n, i[2] = l) : l = i[2];
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];
28
8
  let u;
29
- i[3] !== s || i[4] !== n ? (u = () => s.workflows.getById({ id: n }), i[3] = s, i[4] = n, i[5] = u) : u = i[5];
30
- let d = !!n, f;
31
- return i[6] !== l || i[7] !== u || i[8] !== d ? (f = {
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 = {
32
12
  queryKey: l,
33
13
  queryFn: u,
34
14
  enabled: d
35
- }, i[6] = l, i[7] = u, i[8] = d, i[9] = f) : f = i[9], useQuery(f);
15
+ }, n[6] = l, n[7] = u, n[8] = d, n[9] = f) : f = n[9], useQuery(f);
36
16
  }
37
- function useFetchWorkflowsByPipeline(n) {
38
- let i = c(14), { envKey: a, api: o } = useApiClient(), l;
39
- i[0] === n ? l = i[1] : (l = JSON.stringify({ pipelineId: n }), i[0] = n, i[1] = l);
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);
40
20
  let u;
41
- i[2] === Symbol.for("react.memo_cache_sentinel") ? (u = JSON.stringify([{
21
+ n[2] === Symbol.for("react.memo_cache_sentinel") ? (u = JSON.stringify([{
42
22
  field: "index",
43
23
  order: "ASC"
44
- }]), i[2] = u) : u = i[2];
24
+ }]), n[2] = u) : u = n[2];
45
25
  let f;
46
- i[3] === l ? f = i[4] : (f = {
26
+ n[3] === l ? f = n[4] : (f = {
47
27
  filter: l,
48
28
  sortBy: u
49
- }, i[3] = l, i[4] = f);
29
+ }, n[3] = l, n[4] = f);
50
30
  let p = f, m;
51
- i[5] !== a || i[6] !== n ? (m = getWorkflowsByPipelineCacheKey(a, n), i[5] = a, i[6] = n, i[7] = m) : m = i[7];
31
+ n[5] !== a || n[6] !== e ? (m = getWorkflowsByPipelineCacheKey(a, e), n[5] = a, n[6] = e, n[7] = m) : m = n[7];
52
32
  let h;
53
- i[8] !== o || i[9] !== p ? (h = () => o.workflows.getAll(p), i[8] = o, i[9] = p, i[10] = h) : h = i[10];
33
+ n[8] !== s || n[9] !== p ? (h = () => s.workflows.getAll(p), n[8] = s, n[9] = p, n[10] = h) : h = n[10];
54
34
  let g;
55
- return i[11] !== m || i[12] !== h ? (g = {
35
+ return n[11] !== m || n[12] !== h ? (g = {
56
36
  queryKey: m,
57
37
  queryFn: h,
58
- select: _temp,
59
- enabled: !0
60
- }, i[11] = m, i[12] = h, i[13] = g) : g = i[13], useQuery(g);
38
+ select: _temp
39
+ }, n[11] = m, n[12] = h, n[13] = g) : g = n[13], useQuery(g);
61
40
  }
62
41
  function _temp(e) {
63
42
  return e.data;
64
43
  }
65
- function useFetchWorkflowsByNamespace(n) {
66
- let i = c(14), { envKey: o, api: s } = useApiClient(), l;
67
- i[0] === n ? l = i[1] : (l = JSON.stringify({ namespaceId: n }), i[0] = n, i[1] = l);
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);
68
47
  let u;
69
- i[2] === Symbol.for("react.memo_cache_sentinel") ? (u = JSON.stringify([{
48
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = JSON.stringify([{
70
49
  field: "index",
71
50
  order: "ASC"
72
- }]), i[2] = u) : u = i[2];
51
+ }]), t[2] = u) : u = t[2];
73
52
  let d;
74
- i[3] === l ? d = i[4] : (d = {
53
+ t[3] === l ? d = t[4] : (d = {
75
54
  filter: l,
76
55
  sortBy: u
77
- }, i[3] = l, i[4] = d);
56
+ }, t[3] = l, t[4] = d);
78
57
  let f = d, m;
79
- i[5] !== o || i[6] !== n ? (m = getWorkflowsCacheKey(o, n), i[5] = o, i[6] = n, i[7] = m) : m = i[7];
58
+ t[5] !== a || t[6] !== e ? (m = getWorkflowsCacheKey(a, e), t[5] = a, t[6] = e, t[7] = m) : m = t[7];
80
59
  let h;
81
- i[8] !== s || i[9] !== f ? (h = () => s.workflows.getAll(f), i[8] = s, i[9] = f, i[10] = h) : h = i[10];
60
+ t[8] !== s || t[9] !== f ? (h = () => s.workflows.getAll(f), t[8] = s, t[9] = f, t[10] = h) : h = t[10];
82
61
  let g;
83
- return i[11] !== m || i[12] !== h ? (g = {
62
+ return t[11] !== m || t[12] !== h ? (g = {
84
63
  queryKey: m,
85
64
  queryFn: h,
86
- select: _temp2,
87
- enabled: !0
88
- }, i[11] = m, i[12] = h, i[13] = g) : g = i[13], useQuery(g);
65
+ select: _temp2
66
+ }, t[11] = m, t[12] = h, t[13] = g) : g = t[13], useQuery(g);
89
67
  }
90
68
  function _temp2(e) {
91
69
  return e.data;
92
70
  }
93
71
  function useDeleteWorkflow() {
94
- let r = c(8), { envKey: l, api: u } = useApiClient(), d = useQueryClient(), f;
95
- r[0] === u ? f = r[1] : (f = (e) => u.workflows.delete({ id: e.id }), r[0] = u, r[1] = f);
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);
96
74
  let p;
97
- r[2] !== l || r[3] !== d ? (p = (e, t) => {
98
- d.removeQueries({ queryKey: getWorkflowCacheKey(l, t.id) }), d.invalidateQueries({ queryKey: getWorkflowsCacheKey(l, t.namespaceId) }), d.invalidateQueries({ queryKey: getWorkflowsByPipelineCacheKey(l, t.pipelineId) });
99
- }, r[2] = l, r[3] = d, r[4] = p) : p = r[4];
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];
100
78
  let m;
101
- return r[5] !== f || r[6] !== p ? (m = {
79
+ return o[5] !== f || o[6] !== p ? (m = {
102
80
  mutationFn: f,
103
81
  onSuccess: p
104
- }, r[5] = f, r[6] = p, r[7] = m) : m = r[7], useMutation(m);
82
+ }, o[5] = f, o[6] = p, o[7] = m) : m = o[7], useMutation(m);
105
83
  }
106
- export { getWorkflowCacheKey, getWorkflowsByPipelineCacheKey, getWorkflowsCacheKey, useDeleteWorkflow, useFetchWorkflowsByNamespace, useFetchWorkflowsByPipeline, useWorkflow };
84
+ export { useDeleteWorkflow, useFetchWorkflowsByNamespace, useFetchWorkflowsByPipeline, useWorkflow };
@@ -1,135 +1,130 @@
1
+ import { getWorkspaceCacheKey, getWorkspacesCacheKey } from "./query-keys.js";
1
2
  import { useApiClient } from "./useApi.js";
2
3
  import { c } from "react/compiler-runtime";
3
4
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
4
- function useWorkspace(n) {
5
- let i = c(10), { envKey: a, api: o } = useApiClient(), s;
6
- i[0] !== a || i[1] !== n ? (s = [
7
- "workspace",
8
- n,
9
- a
10
- ], i[0] = a, i[1] = n, i[2] = s) : s = i[2];
11
- let l;
12
- i[3] !== o || i[4] !== n ? (l = () => o.workspaces.getById({ id: n }), i[3] = o, i[4] = n, i[5] = l) : l = i[5];
13
- let u = !!n, d;
14
- return i[6] !== s || i[7] !== l || i[8] !== u ? (d = {
15
- queryKey: s,
16
- queryFn: l,
17
- enabled: u
18
- }, i[6] = s, i[7] = l, i[8] = u, i[9] = d) : d = i[9], useQuery(d);
5
+ function useWorkspace(t) {
6
+ let i = c(10), { envKey: o, api: s } = useApiClient(), l;
7
+ i[0] !== o || i[1] !== t ? (l = getWorkspaceCacheKey(o, t), i[0] = o, i[1] = t, i[2] = l) : l = i[2];
8
+ let u;
9
+ i[3] !== s || i[4] !== t ? (u = () => s.workspaces.getById({ id: t }), i[3] = s, i[4] = t, i[5] = u) : u = i[5];
10
+ let d = !!t, f;
11
+ return i[6] !== l || i[7] !== u || i[8] !== d ? (f = {
12
+ queryKey: l,
13
+ queryFn: u,
14
+ enabled: d
15
+ }, i[6] = l, i[7] = u, i[8] = d, i[9] = f) : f = i[9], useQuery(f);
19
16
  }
20
- function useFilterWorkspaces(n, i, a, o, s, l) {
21
- let u = c(23), d = a === void 0 ? "id" : a, f = o === void 0 ? "DESC" : o, p = s === void 0 ? 0 : s, m = l === void 0 ? 10 : l, { envKey: h, api: g } = useApiClient(), _ = Object.keys(i).length > 0, v;
22
- u[0] !== i || u[1] !== _ ? (v = _ && { filter: JSON.stringify(i) }, u[0] = i, u[1] = _, u[2] = v) : v = u[2];
23
- let y;
24
- u[3] !== f || u[4] !== d ? (y = JSON.stringify([{
25
- field: d,
26
- order: f
27
- }]), u[3] = f, u[4] = d, u[5] = y) : y = u[5];
28
- let b;
29
- u[6] === n ? b = u[7] : (b = n && {
30
- search: n,
17
+ function useFilterWorkspaces(e, i, o, s, l, u) {
18
+ let d = c(30), f = o === void 0 ? "id" : o, p = s === void 0 ? "DESC" : s, m = l === void 0 ? 0 : l, h = u === void 0 ? 10 : u, { envKey: g, api: _ } = useApiClient(), v = Object.keys(i).length > 0, y;
19
+ d[0] !== i || d[1] !== v ? (y = v ? JSON.stringify(i) : void 0, d[0] = i, 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,
31
30
  searchColumns: JSON.stringify(["title"])
32
- }, u[6] = n, u[7] = b);
33
- let x;
34
- u[8] !== m || u[9] !== p || u[10] !== v || u[11] !== y || u[12] !== b ? (x = {
35
- ...v,
36
- sortBy: y,
37
- page: p,
38
- limit: m,
39
- ...b
40
- }, u[8] = m, u[9] = p, u[10] = v, u[11] = y, u[12] = b, u[13] = x) : x = u[13];
41
- let S = x, C;
42
- u[14] !== h || u[15] !== S ? (C = [
43
- "workspaces",
44
- h,
45
- S
46
- ], u[14] = h, u[15] = S, u[16] = C) : C = u[16];
31
+ }, d[8] = e, d[9] = C);
47
32
  let w;
48
- u[17] !== g || u[18] !== S ? (w = () => g.workspaces.getAll(S), u[17] = g, u[18] = S, u[19] = w) : w = u[19];
49
- let T;
50
- return u[20] !== C || u[21] !== w ? (T = {
51
- queryKey: C,
52
- queryFn: w,
53
- enabled: !0
54
- }, u[20] = C, u[21] = w, u[22] = T) : T = u[22], useQuery(T);
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
+ ...getWorkspacesCacheKey(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 = () => _.workspaces.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);
55
58
  }
56
59
  function useCreateWorkspace() {
57
- let r = c(8), { envKey: a, api: o } = useApiClient(), s = useQueryClient(), l;
58
- r[0] === o ? l = r[1] : (l = (e) => o.workspaces.create(e), r[0] = o, r[1] = l);
59
- let u;
60
- r[2] !== a || r[3] !== s ? (u = () => {
61
- s.invalidateQueries({ queryKey: ["workspaces", a] });
62
- }, r[2] = a, r[3] = s, r[4] = u) : u = r[4];
60
+ let e = c(8), { envKey: a, api: s } = useApiClient(), l = useQueryClient(), u;
61
+ e[0] === s ? u = e[1] : (u = (e) => s.workspaces.create(e), e[0] = s, e[1] = u);
63
62
  let d;
64
- return r[5] !== l || r[6] !== u ? (d = {
65
- mutationFn: l,
66
- onSuccess: u
67
- }, r[5] = l, r[6] = u, r[7] = d) : d = r[7], useMutation(d);
63
+ e[2] !== a || e[3] !== l ? (d = () => {
64
+ l.invalidateQueries({ queryKey: getWorkspacesCacheKey(a) });
65
+ }, e[2] = a, e[3] = l, e[4] = d) : d = e[4];
66
+ let f;
67
+ return e[5] !== u || e[6] !== d ? (f = {
68
+ mutationFn: u,
69
+ onSuccess: d
70
+ }, e[5] = u, e[6] = d, e[7] = f) : f = e[7], useMutation(f);
68
71
  }
69
72
  function useUpdateWorkspace() {
70
- let r = c(8), { envKey: a, api: o } = useApiClient(), s = useQueryClient(), l;
71
- r[0] === o ? l = r[1] : (l = (e) => o.workspaces.update(e), r[0] = o, r[1] = l);
72
- let u;
73
- r[2] !== a || r[3] !== s ? (u = (e, t) => {
74
- s.invalidateQueries({ queryKey: [
75
- "workspace",
76
- t.id,
77
- a
78
- ] }), s.invalidateQueries({ queryKey: ["workspaces", a] });
79
- }, r[2] = a, r[3] = s, r[4] = u) : u = r[4];
80
- let d;
81
- return r[5] !== l || r[6] !== u ? (d = {
82
- mutationFn: l,
83
- onSuccess: u
84
- }, r[5] = l, r[6] = u, r[7] = d) : d = r[7], useMutation(d);
73
+ let a = c(8), { envKey: s, api: l } = useApiClient(), u = useQueryClient(), d;
74
+ a[0] === l ? d = a[1] : (d = (e) => l.workspaces.update(e), a[0] = l, a[1] = d);
75
+ let f;
76
+ a[2] !== s || a[3] !== u ? (f = (n, r) => {
77
+ u.invalidateQueries({ queryKey: getWorkspaceCacheKey(s, r.id) }), u.invalidateQueries({ queryKey: getWorkspacesCacheKey(s) });
78
+ }, a[2] = s, a[3] = u, a[4] = f) : f = a[4];
79
+ let p;
80
+ return a[5] !== d || a[6] !== f ? (p = {
81
+ mutationFn: d,
82
+ onSuccess: f
83
+ }, a[5] = d, a[6] = f, a[7] = p) : p = a[7], useMutation(p);
85
84
  }
86
85
  function useDeleteWorkspace() {
87
- let r = c(8), { envKey: a, api: o } = useApiClient(), s = useQueryClient(), l;
88
- r[0] === o ? l = r[1] : (l = (e) => o.workspaces.delete({ id: e }), r[0] = o, r[1] = l);
89
- let u;
90
- r[2] !== a || r[3] !== s ? (u = (e, t) => {
91
- s.removeQueries({ queryKey: [
92
- "workspace",
93
- t,
94
- a
95
- ] }), s.invalidateQueries({ queryKey: ["workspaces", a] });
96
- }, r[2] = a, r[3] = s, r[4] = u) : u = r[4];
97
- let d;
98
- return r[5] !== l || r[6] !== u ? (d = {
99
- mutationFn: l,
100
- onSuccess: u
101
- }, r[5] = l, r[6] = u, r[7] = d) : d = r[7], useMutation(d);
86
+ let a = c(8), { envKey: s, api: l } = useApiClient(), u = useQueryClient(), d;
87
+ a[0] === l ? d = a[1] : (d = (e) => l.workspaces.delete({ id: e }), a[0] = l, a[1] = d);
88
+ let f;
89
+ a[2] !== s || a[3] !== u ? (f = (n, r) => {
90
+ u.removeQueries({ queryKey: getWorkspaceCacheKey(s, r) }), u.invalidateQueries({ queryKey: getWorkspacesCacheKey(s) });
91
+ }, a[2] = s, a[3] = u, a[4] = f) : f = a[4];
92
+ let p;
93
+ return a[5] !== d || a[6] !== f ? (p = {
94
+ mutationFn: d,
95
+ onSuccess: f
96
+ }, a[5] = d, a[6] = f, a[7] = p) : p = a[7], useMutation(p);
102
97
  }
103
98
  function useSetFavouriteWorkspace() {
104
- let r = c(8), { envKey: a, api: o } = useApiClient(), s = useQueryClient(), l;
105
- r[0] === o ? l = r[1] : (l = (e) => {
99
+ let e = c(8), { envKey: a, api: s } = useApiClient(), l = useQueryClient(), u;
100
+ e[0] === s ? u = e[1] : (u = (e) => {
106
101
  let { id: t, isFavourite: n } = e;
107
- return o.workspaces.setFavourite({
102
+ return s.workspaces.setFavourite({
108
103
  id: t,
109
104
  workspaceFavouriteDto: { isFavourite: n }
110
105
  });
111
- }, r[0] = o, r[1] = l);
112
- let u;
113
- r[2] !== a || r[3] !== s ? (u = () => {
114
- s.invalidateQueries({ queryKey: ["workspaces", a] });
115
- }, r[2] = a, r[3] = s, r[4] = u) : u = r[4];
106
+ }, e[0] = s, e[1] = u);
116
107
  let d;
117
- return r[5] !== l || r[6] !== u ? (d = {
118
- mutationFn: l,
119
- onSuccess: u
120
- }, r[5] = l, r[6] = u, r[7] = d) : d = r[7], useMutation(d);
108
+ e[2] !== a || e[3] !== l ? (d = () => {
109
+ l.invalidateQueries({ queryKey: getWorkspacesCacheKey(a) });
110
+ }, e[2] = a, e[3] = l, e[4] = d) : d = e[4];
111
+ let f;
112
+ return e[5] !== u || e[6] !== d ? (f = {
113
+ mutationFn: u,
114
+ onSuccess: d
115
+ }, e[5] = u, e[6] = d, e[7] = f) : f = e[7], useMutation(f);
121
116
  }
122
117
  function useBatchDeleteWorkspaces() {
123
- let r = c(8), { envKey: a, api: o } = useApiClient(), s = useQueryClient(), l;
124
- r[0] === o ? l = r[1] : (l = (e) => o.workspaces.batchDelete({ ids: e }), r[0] = o, r[1] = l);
125
- let u;
126
- r[2] !== a || r[3] !== s ? (u = () => {
127
- s.invalidateQueries({ queryKey: ["workspaces", a] });
128
- }, r[2] = a, r[3] = s, r[4] = u) : u = r[4];
118
+ let e = c(8), { envKey: a, api: s } = useApiClient(), l = useQueryClient(), u;
119
+ e[0] === s ? u = e[1] : (u = (e) => s.workspaces.batchDelete({ ids: e }), e[0] = s, e[1] = u);
129
120
  let d;
130
- return r[5] !== l || r[6] !== u ? (d = {
131
- mutationFn: l,
132
- onSuccess: u
133
- }, r[5] = l, r[6] = u, r[7] = d) : d = r[7], useMutation(d);
121
+ e[2] !== a || e[3] !== l ? (d = () => {
122
+ l.invalidateQueries({ queryKey: getWorkspacesCacheKey(a) });
123
+ }, e[2] = a, e[3] = l, e[4] = d) : d = e[4];
124
+ let f;
125
+ return e[5] !== u || e[6] !== d ? (f = {
126
+ mutationFn: u,
127
+ onSuccess: d
128
+ }, e[5] = u, e[6] = d, e[7] = f) : f = e[7], useMutation(f);
134
129
  }
135
130
  export { useBatchDeleteWorkspaces, useCreateWorkspace, useDeleteWorkspace, useFilterWorkspaces, useSetFavouriteWorkspace, useUpdateWorkspace, useWorkspace };
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ import { AxiosInstance } from 'axios';
6
6
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
7
7
  import { ClassProp } from 'class-variance-authority/types';
8
8
  import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
9
+ import { Component } from 'react';
9
10
  import { ComponentType } from 'react';
10
11
  import { Context } from 'react';
11
12
  import { DashboardStatsInterface } from '@loopstack/contracts/api';
@@ -15,6 +16,7 @@ import { DocumentItemInterface } from '@loopstack/contracts/api';
15
16
  import { Drawer as Drawer_2 } from 'vaul';
16
17
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
17
18
  import { EnvironmentConfigInterface } from '@loopstack/contracts/api';
19
+ import { ErrorInfo } from 'react';
18
20
  import { ExternalToast } from 'sonner';
19
21
  import { FileContentInterface } from '@loopstack/contracts/api';
20
22
  import { FileExplorerNodeInterface } from '@loopstack/contracts/api';
@@ -124,6 +126,10 @@ declare interface BaseSnackbarProps {
124
126
  onDismiss?: () => void;
125
127
  }
126
128
 
129
+ declare interface BasicErrorComponentProps {
130
+ error?: string | null;
131
+ }
132
+
127
133
  export declare interface BatchAction {
128
134
  id: string;
129
135
  label: string;
@@ -216,6 +222,8 @@ declare interface CompletionMessagePaperProps {
216
222
  export declare interface ComponentOverrides {
217
223
  CreateWorkspace?: ComponentType<CreateWorkspaceProps>;
218
224
  EditWorkspace?: ComponentType<EditWorkspaceProps>;
225
+ SidebarHeader?: ComponentType;
226
+ SidebarFooter?: ComponentType;
219
227
  }
220
228
 
221
229
  export declare const ComponentOverridesProvider: ({ children, overrides, }: {
@@ -376,6 +384,8 @@ export declare function createApiClient(environment: Environment): {
376
384
  auth: ApiClient['auth'];
377
385
  };
378
386
 
387
+ export declare const CreateWorkspace: ({ types, workspace, onSuccess }: CreateWorkspaceProps) => JSX.Element;
388
+
379
389
  export declare interface CreateWorkspaceProps {
380
390
  types: WorkspaceConfigInterface[];
381
391
  workspace?: WorkspaceItemInterface;
@@ -631,6 +641,27 @@ declare interface EnvironmentSlotSelectorProps {
631
641
  error?: string;
632
642
  }
633
643
 
644
+ export declare const ErrorAlert: default_2.FC<BasicErrorComponentProps>;
645
+
646
+ export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
647
+ state: ErrorBoundaryState;
648
+ static getDerivedStateFromError(error: Error): ErrorBoundaryState;
649
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
650
+ handleRetry: () => void;
651
+ render(): ReactNode;
652
+ }
653
+
654
+ declare interface ErrorBoundaryProps {
655
+ children: ReactNode;
656
+ fallback?: ReactNode;
657
+ onRetry?: () => void;
658
+ }
659
+
660
+ declare interface ErrorBoundaryState {
661
+ hasError: boolean;
662
+ error: Error | null;
663
+ }
664
+
634
665
  export declare const ErrorSnackbar: default_2.FC<ErrorSnackbarProps>;
635
666
 
636
667
  declare interface ErrorSnackbarProps {
@@ -650,6 +681,62 @@ export declare type FilterOption = string | {
650
681
  value: string;
651
682
  };
652
683
 
684
+ export declare function getAllWorkflowsCacheKey(envKey: string): string[];
685
+
686
+ export declare function getAvailableEnvironmentsCacheKey(envKey: string): string[];
687
+
688
+ export declare function getDashboardStatsCacheKey(envKey: string): string[];
689
+
690
+ export declare function getDocumentCacheKey(envKey: string, documentId: string): string[];
691
+
692
+ export declare function getDocumentsCacheKey(envKey: string, workflowId: string): string[];
693
+
694
+ export declare function getFileContentCacheKey(envKey: string, pipelineId: string, filePath: string): string[];
695
+
696
+ export declare function getFileTreeCacheKey(envKey: string, pipelineId: string): string[];
697
+
698
+ export declare function getHealthCacheKey(envKey: string): string[];
699
+
700
+ /**
701
+ * Centralized cache key builders for React Query.
702
+ *
703
+ * Conventions:
704
+ * - All keys start with a domain prefix, followed by envKey for environment scoping.
705
+ * - Singular keys (e.g. 'pipeline') are for single-entity queries.
706
+ * - Plural keys (e.g. 'pipelines') are for list/filter queries.
707
+ * - Mutations should invalidate the plural key to catch all list variations.
708
+ * - Use `select` (not `.then()` in queryFn) for response transformations.
709
+ */
710
+ export declare function getMeCacheKey(envKey: string): string[];
711
+
712
+ export declare function getNamespaceCacheKey(envKey: string, namespaceId: string): string[];
713
+
714
+ export declare function getNamespacesByPipelineCacheKey(envKey: string, pipelineId: string): string[];
715
+
716
+ export declare function getPipelineCacheKey(envKey: string, id: string): string[];
717
+
718
+ export declare function getPipelineConfigCacheKey(envKey: string, workspaceBlockName: string, pipelineBlockName: string): string[];
719
+
720
+ export declare function getPipelinesCacheKey(envKey: string): string[];
721
+
722
+ export declare function getPipelinesChildrenCacheKey(envKey: string, parentId: string): string[];
723
+
724
+ export declare function getPipelineSourceCacheKey(envKey: string, workspaceBlockName: string, pipelineBlockName: string): string[];
725
+
726
+ export declare function getPipelineTypesCacheKey(envKey: string, workspaceBlockName: string): string[];
727
+
728
+ export declare function getWorkflowCacheKey(envKey: string, workflowId: string): string[];
729
+
730
+ export declare function getWorkflowsByPipelineCacheKey(envKey: string, pipelineId: string): string[];
731
+
732
+ export declare function getWorkflowsCacheKey(envKey: string, namespaceId: string): string[];
733
+
734
+ export declare function getWorkspaceCacheKey(envKey: string, id: string): string[];
735
+
736
+ export declare function getWorkspacesCacheKey(envKey: string): string[];
737
+
738
+ export declare function getWorkspaceTypesCacheKey(envKey: string): string[];
739
+
653
740
  export declare const GoogleLogo: default_2.FC<GoogleLogoProps>;
654
741
 
655
742
  declare interface GoogleLogoProps {
@@ -741,8 +828,10 @@ export declare const LocalHealthCheck: () => JSX.Element | null;
741
828
  export declare class LocalRouter implements StudioRouter {
742
829
  private navigate;
743
830
  private envId;
744
- constructor(navigate: ReturnType<typeof useNavigate>, envId: string);
831
+ private embedPrefix;
832
+ constructor(navigate: ReturnType<typeof useNavigate>, envId: string, embedPrefix?: string);
745
833
  navigateToHome(): Promise<void>;
834
+ getEnvironmentInfo(): string;
746
835
  navigateToEnvironmentInfo(): Promise<void>;
747
836
  getRuns(): string;
748
837
  getRunsActionRequired(): string;
@@ -761,6 +850,8 @@ export declare class LocalRouter implements StudioRouter {
761
850
  navigateToPipelineDebug(pipelineId: string): Promise<void>;
762
851
  navigateToWorkflow(pipelineId: string, workflowId: string, clickId: string | undefined): Promise<void>;
763
852
  navigateToPipelineNamespace(workspaceId: string, pipelineId: string, namespaceId: string): Promise<void>;
853
+ getWorkspaceRuns(workspaceId: string): string;
854
+ navigateToWorkspaceRuns(workspaceId: string): Promise<void>;
764
855
  getEmbedPipeline(pipelineId: string): string;
765
856
  getPreviewPipeline(pipelineId: string): string;
766
857
  getCurrentEnvironmentId(): string;
@@ -1025,6 +1116,7 @@ export declare const StudioProvider: ({ children, router, environment, }: {
1025
1116
 
1026
1117
  export declare interface StudioRouter {
1027
1118
  navigateToHome(): Promise<void>;
1119
+ getEnvironmentInfo(): string;
1028
1120
  navigateToEnvironmentInfo(): Promise<void>;
1029
1121
  getRuns(): string;
1030
1122
  getRunsActionRequired(): string;
@@ -1043,12 +1135,16 @@ export declare interface StudioRouter {
1043
1135
  navigateToPipelineDebug(pipelineId: string): Promise<void>;
1044
1136
  navigateToWorkflow(pipelineId: string, workflowId: string, clickId: string | undefined): Promise<void>;
1045
1137
  navigateToPipelineNamespace(workspaceId: string, pipelineId: string, namespaceId: string): Promise<void>;
1138
+ getWorkspaceRuns(workspaceId: string): string;
1139
+ navigateToWorkspaceRuns(workspaceId: string): Promise<void>;
1046
1140
  getEmbedPipeline(pipelineId: string): string;
1047
1141
  getPreviewPipeline(pipelineId: string): string;
1048
1142
  getCurrentEnvironmentId(): string;
1049
1143
  getTheme(): 'local' | 'cloud';
1050
1144
  }
1051
1145
 
1146
+ export declare const StudioSidebar: () => JSX.Element;
1147
+
1052
1148
  export declare function Switch({ className, ...props }: React_2.ComponentProps<typeof SwitchPrimitive.Root>): JSX.Element;
1053
1149
 
1054
1150
  export declare function Table({ className, ...props }: React_2.ComponentProps<'table'>): JSX.Element;
@@ -1116,11 +1212,13 @@ export declare function useIsMobile(): boolean;
1116
1212
 
1117
1213
  export declare function usePipeline(id: string | undefined): UseQueryResult<PipelineInterface, Error>;
1118
1214
 
1119
- export declare function usePipelineConfig(workspaceBlockName: string | undefined, pipelineBlockName: string | undefined): UseQueryResult<PipelineConfigInterface, Error>;
1215
+ export declare function usePipelineConfig(workspaceBlockName: string | undefined): UseQueryResult<PipelineConfigInterface[], Error>;
1216
+
1217
+ export declare function usePipelineConfigByName(workspaceBlockName: string | undefined, pipelineBlockName: string | undefined): UseQueryResult<PipelineConfigInterface, Error>;
1120
1218
 
1121
1219
  export declare function usePipelineSource(workspaceBlockName: string | undefined, pipelineBlockName: string | undefined): UseQueryResult<PipelineSourceInterface, Error>;
1122
1220
 
1123
- export declare const useRouter: (envId: string) => StudioRouter;
1221
+ export declare const useRouter: (envId: string, embedPrefix?: string) => StudioRouter;
1124
1222
 
1125
1223
  export declare function useSetFavouriteWorkspace(): UseMutationResult<void, Error, {
1126
1224
  id: string;
@@ -1131,6 +1229,8 @@ export declare function useSidebar(): SidebarContextProps;
1131
1229
 
1132
1230
  export declare const useStudio: () => StudioContext;
1133
1231
 
1232
+ export declare const useStudioOptional: () => StudioContext | null;
1233
+
1134
1234
  export declare function useUpdatePipeline(): UseMutationResult<PipelineInterface, Error, {
1135
1235
  id: string;
1136
1236
  pipelineUpdateDto: PipelineUpdateInterface;
@@ -1156,6 +1256,8 @@ export declare function WorkbenchPage({ previewPanelOpen, onPreviewPanelOpenChan
1156
1256
 
1157
1257
  export declare const WorkspacePage: () => JSX.Element;
1158
1258
 
1259
+ export declare const WorkspaceRunsPage: () => JSX.Element;
1260
+
1159
1261
  export declare function WorkspacesPage(): JSX.Element;
1160
1262
 
1161
1263
  export { }