@loopstack/loopstack-studio 0.21.3 → 0.23.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 (126) hide show
  1. package/dist/api/auth.js +10 -0
  2. package/dist/api/client.js +13 -0
  3. package/dist/api/config.js +10 -0
  4. package/dist/api/dashboard.js +4 -0
  5. package/dist/api/documents.js +7 -0
  6. package/dist/api/index.js +24 -0
  7. package/dist/api/namespaces.js +7 -0
  8. package/dist/api/pipelines.js +13 -0
  9. package/dist/api/processor.js +4 -0
  10. package/dist/api/workflows.js +8 -0
  11. package/dist/api/workspaces.js +12 -0
  12. package/dist/app/EnvironmentEmbedRoot.js +35 -0
  13. package/dist/components/data-table/DataTableFilters.js +74 -63
  14. package/dist/components/feedback/ErrorBoundary.js +43 -0
  15. package/dist/components/{LoadingCentered.js → feedback/LoadingCentered.js} +1 -1
  16. package/dist/components/feedback/index.js +5 -0
  17. package/dist/components/index.js +6 -3
  18. package/dist/components/layout/MainLayout.js +36 -17
  19. package/dist/components/layout/StudioSidebar.js +165 -0
  20. package/dist/components/page/PageBreadcrumbs.js +1 -1
  21. package/dist/components/ui/sidebar.js +359 -359
  22. package/dist/components/ui-widgets/UiActions.js +22 -15
  23. package/dist/components/ui-widgets/UiWidget.js +31 -26
  24. package/dist/components/ui-widgets/widgets/AiPromptInput.js +27 -27
  25. package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +12 -12
  26. package/dist/components/ui-widgets/widgets/SandboxRun.js +33 -0
  27. package/dist/components/ui-widgets/widgets/SubmitButton.js +11 -11
  28. package/dist/features/code-explorer/CodeExplorer.js +4 -67
  29. package/dist/features/code-explorer/components/CodeExplorerTree.js +3 -41
  30. package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +4 -80
  31. package/dist/features/code-explorer/components/FileContentViewer.js +1 -0
  32. package/dist/features/code-explorer/components/FileTabsBar.js +1 -1
  33. package/dist/features/code-explorer/index.js +4 -0
  34. package/dist/features/code-explorer/utils/fileIcons.js +4 -7
  35. package/dist/features/debug/components/ConfigFlowViewer.js +1 -1
  36. package/dist/features/debug/components/PipelineFlowViewer.js +1 -1
  37. package/dist/features/debug/index.js +3 -0
  38. package/dist/features/documents/DocumentRenderer.js +53 -0
  39. package/dist/features/{workbench → documents}/components/DocumentItem.js +1 -1
  40. package/dist/features/documents/components/DocumentList.js +40 -0
  41. package/dist/features/{workbench → documents}/components/DocumentMetadataPills.js +2 -2
  42. package/dist/features/{workbench/components → documents}/document-details/DocumentDetails.js +3 -3
  43. package/dist/features/{workbench/components → documents}/document-details/PromptDetails.js +3 -3
  44. package/dist/features/documents/index.js +4 -0
  45. package/dist/features/{workbench/components/document-renderer → documents/renderers}/AiMessage.js +5 -5
  46. package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentDebugRenderer.js +1 -1
  47. package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentFormRenderer.js +9 -8
  48. package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentMessageRenderer.js +1 -1
  49. package/dist/features/{workbench/components/document-renderer → documents/renderers}/ErrorMessageRenderer.js +1 -1
  50. package/dist/features/{workbench/components/document-renderer → documents/renderers}/LinkMessageRenderer.js +1 -1
  51. package/dist/features/{workbench/components/document-renderer → documents/renderers}/MarkdownMessageRenderer.js +2 -2
  52. package/dist/features/{workbench/components/document-renderer → documents/renderers}/PlainMessageRenderer.js +1 -1
  53. package/dist/features/health/index.js +1 -0
  54. package/dist/features/oauth/OAuthPromptRenderer.js +1 -1
  55. package/dist/features/runs/Runs.js +197 -0
  56. package/dist/features/workbench/NavigationItems.js +29 -29
  57. package/dist/features/workbench/Workbench.js +100 -78
  58. package/dist/features/workbench/WorkflowItem.js +63 -58
  59. package/dist/features/workbench/WorkflowList.js +62 -82
  60. package/dist/features/workbench/components/NewRunDialog.js +329 -0
  61. package/dist/features/workbench/components/WorkbenchFloatingPanel.js +88 -0
  62. package/dist/features/workbench/components/WorkbenchFlowPanel.js +49 -0
  63. package/dist/features/workbench/components/WorkbenchIconSidebar.js +68 -0
  64. package/dist/features/workbench/components/WorkbenchPreviewPanel.js +128 -0
  65. package/dist/features/workbench/components/WorkflowForms.js +7 -6
  66. package/dist/features/workbench/components/WorkflowHistoryItem.js +74 -69
  67. package/dist/features/workbench/components/buttons/WorkflowButtons.js +78 -61
  68. package/dist/features/workbench/hooks/useWorkflowData.js +49 -0
  69. package/dist/features/workbench/hooks/useWorkflowListState.js +50 -0
  70. package/dist/features/workbench/index.js +8 -0
  71. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +76 -0
  72. package/dist/features/workspaces/Workspaces.js +2 -2
  73. package/dist/features/workspaces/components/CreateWorkspace.js +165 -82
  74. package/dist/features/workspaces/components/EnvironmentSlotSelector.js +63 -0
  75. package/dist/features/workspaces/components/ExecutionTimeline.js +70 -69
  76. package/dist/features/workspaces/components/PipelineForm.js +4 -4
  77. package/dist/features/workspaces/index.js +3 -0
  78. package/dist/hooks/index.js +3 -0
  79. package/dist/hooks/query-keys.js +138 -0
  80. package/dist/hooks/useApi.js +9 -33
  81. package/dist/hooks/useAuth.js +37 -56
  82. package/dist/hooks/useConfig.js +27 -33
  83. package/dist/hooks/useDashboard.js +9 -16
  84. package/dist/hooks/useDebounce.js +8 -17
  85. package/dist/hooks/useDocuments.js +7 -16
  86. package/dist/hooks/useFiles.js +24 -42
  87. package/dist/hooks/useNamespaces.js +7 -16
  88. package/dist/hooks/usePipelines.js +141 -174
  89. package/dist/hooks/useProcessor.js +11 -17
  90. package/dist/hooks/useWorkflows.js +51 -89
  91. package/dist/hooks/useWorkspaces.js +97 -129
  92. package/dist/index.d.ts +364 -50
  93. package/dist/index.js +21 -6
  94. package/dist/packages/contracts/dist/enums/index.js +25 -0
  95. package/dist/packages/contracts/dist/enums/pipeline-state.js +10 -0
  96. package/dist/packages/contracts/dist/enums/registry.enum.js +20 -0
  97. package/dist/packages/contracts/dist/enums/sort-order.enum.js +10 -0
  98. package/dist/packages/contracts/dist/enums/user-type.enum.js +10 -0
  99. package/dist/packages/contracts/dist/enums/workflow-state.enum.js +10 -0
  100. package/dist/pages/DashboardPage.js +1 -1
  101. package/dist/pages/DebugPage.js +12 -14
  102. package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
  103. package/dist/pages/DebugWorkflowsPage.js +3 -4
  104. package/dist/pages/EmbedWorkbenchPage.js +7 -5
  105. package/dist/pages/PipelineDebugPage.js +7 -6
  106. package/dist/pages/PreviewWorkbenchPage.js +419 -0
  107. package/dist/pages/RunsListPage.js +64 -0
  108. package/dist/pages/RunsPage.js +49 -0
  109. package/dist/pages/StudioLandingPage.js +146 -0
  110. package/dist/pages/WorkbenchPage.js +78 -53
  111. package/dist/pages/WorkspacePage.js +1 -1
  112. package/dist/providers/InvalidationEventsProvider.js +15 -17
  113. package/dist/providers/QueryProvider.js +21 -0
  114. package/dist/providers/StudioProvider.js +2 -2
  115. package/dist/routing/LocalRouter.js +20 -7
  116. package/dist/services/createApiClient.js +4 -10
  117. package/dist/services/index.js +1 -1
  118. package/package.json +2 -3
  119. package/dist/features/workbench/components/DocumentList.js +0 -40
  120. package/dist/features/workbench/components/DocumentRenderer.js +0 -54
  121. package/dist/features/workbench/components/WorkbenchSidebar.js +0 -109
  122. package/dist/features/workbench/providers/WorkbenchContextProvider.js +0 -3
  123. /package/dist/components/{content → feedback}/ErrorAlert.js +0 -0
  124. /package/dist/components/{snackbars → feedback}/ErrorSnackbar.js +0 -0
  125. /package/dist/components/{snackbars → feedback}/Snackbar.js +0 -0
  126. /package/dist/features/{workbench/components/document-renderer → documents/renderers}/AiMessageContent.js +0 -0
@@ -0,0 +1,10 @@
1
+ function createAuthApi(e) {
2
+ return {
3
+ me: () => e.get("/api/v1/auth/me").then((e) => e.data),
4
+ getInfo: () => e.get("/api/v1/auth/worker/health").then((e) => e.data),
5
+ hubLogin: (t) => e.post("/api/v1/auth/oauth/hub", t.hubLoginRequestDto).then((e) => e.data),
6
+ refresh: () => e.post("/api/v1/auth/refresh").then((e) => e.data),
7
+ logout: () => e.post("/api/v1/auth/logout").then((e) => e.data)
8
+ };
9
+ }
10
+ export { createAuthApi };
@@ -0,0 +1,13 @@
1
+ import { ApiClientEvents } from "../events/api-client-events.js";
2
+ import { eventBus } from "../services/eventEmitter.js";
3
+ import "../services/index.js";
4
+ import axios from "axios";
5
+ function createAxiosClient(r, i) {
6
+ let a = axios.create({
7
+ baseURL: r,
8
+ withCredentials: !0,
9
+ headers: { "Content-Type": "application/json" }
10
+ });
11
+ return a.interceptors.response.use((e) => e, (n) => (n.response?.status && [401, 403].includes(n.response.status) && eventBus.emit(ApiClientEvents.UNAUTHORIZED, i), n.code === "ERR_NETWORK" && (console.error("Connection refused - server may be down"), eventBus.emit(ApiClientEvents.ERR_NETWORK, i)), Promise.reject(n))), a;
12
+ }
13
+ export { createAxiosClient };
@@ -0,0 +1,10 @@
1
+ function createConfigApi(e) {
2
+ return {
3
+ getWorkspaceTypes: () => e.get("/api/v1/config/workspaces").then((e) => e.data),
4
+ getPipelineTypesByWorkspace: (t) => e.get(`/api/v1/config/workspaces/${encodeURIComponent(t.workspaceBlockName)}/pipelines`).then((e) => e.data),
5
+ getPipelineConfigByName: (t) => e.get(`/api/v1/config/workspaces/${encodeURIComponent(t.workspaceBlockName)}/pipelines/${encodeURIComponent(t.pipelineName)}`).then((e) => e.data),
6
+ getPipelineSourceByName: (t) => e.get(`/api/v1/config/workspaces/${encodeURIComponent(t.workspaceBlockName)}/pipelines/${encodeURIComponent(t.pipelineName)}/source`).then((e) => e.data),
7
+ getAvailableEnvironments: () => e.get("/api/v1/config/environments").then((e) => e.data)
8
+ };
9
+ }
10
+ export { createConfigApi };
@@ -0,0 +1,4 @@
1
+ function createDashboardApi(e) {
2
+ return { getStats: () => e.get("/api/v1/dashboard").then((e) => e.data) };
3
+ }
4
+ export { createDashboardApi };
@@ -0,0 +1,7 @@
1
+ function createDocumentsApi(e) {
2
+ return {
3
+ getById: (t) => e.get(`/api/v1/documents/${t.id}`).then((e) => e.data),
4
+ getAll: (t) => e.get("/api/v1/documents", { params: t }).then((e) => e.data)
5
+ };
6
+ }
7
+ export { createDocumentsApi };
@@ -0,0 +1,24 @@
1
+ import { createAuthApi } from "./auth.js";
2
+ import { createConfigApi } from "./config.js";
3
+ import { createDashboardApi } from "./dashboard.js";
4
+ import { createDocumentsApi } from "./documents.js";
5
+ import { createNamespacesApi } from "./namespaces.js";
6
+ import { createPipelinesApi } from "./pipelines.js";
7
+ import { createProcessorApi } from "./processor.js";
8
+ import { createWorkflowsApi } from "./workflows.js";
9
+ import { createWorkspacesApi } from "./workspaces.js";
10
+ import { createAxiosClient } from "./client.js";
11
+ function createApi(u) {
12
+ return {
13
+ auth: createAuthApi(u),
14
+ config: createConfigApi(u),
15
+ dashboard: createDashboardApi(u),
16
+ documents: createDocumentsApi(u),
17
+ namespaces: createNamespacesApi(u),
18
+ pipelines: createPipelinesApi(u),
19
+ processor: createProcessorApi(u),
20
+ workflows: createWorkflowsApi(u),
21
+ workspaces: createWorkspacesApi(u)
22
+ };
23
+ }
24
+ export { createApi };
@@ -0,0 +1,7 @@
1
+ function createNamespacesApi(e) {
2
+ return {
3
+ getById: (t) => e.get(`/api/v1/namespaces/${t.id}`).then((e) => e.data),
4
+ getAll: (t) => e.get("/api/v1/namespaces", { params: t }).then((e) => e.data)
5
+ };
6
+ }
7
+ export { createNamespacesApi };
@@ -0,0 +1,13 @@
1
+ function createPipelinesApi(e) {
2
+ return {
3
+ getById: (t) => e.get(`/api/v1/pipelines/${t.id}`).then((e) => e.data),
4
+ getAll: (t) => e.get("/api/v1/pipelines", { params: t }).then((e) => e.data),
5
+ create: (t) => e.post("/api/v1/pipelines", t.pipelineCreateDto).then((e) => e.data),
6
+ update: (t) => e.put(`/api/v1/pipelines/${t.id}`, t.pipelineUpdateDto).then((e) => e.data),
7
+ delete: (t) => e.delete(`/api/v1/pipelines/id/${t.id}`).then((e) => e.data),
8
+ batchDelete: (t) => e.delete("/api/v1/pipelines/batch", { data: { ids: t.ids } }).then((e) => e.data),
9
+ getFileTree: (t) => e.get(`/api/v1/pipelines/${t.pipelineId}/files`).then((e) => e.data),
10
+ getFileContent: (t) => e.get(`/api/v1/pipelines/${t.pipelineId}/files/${t.filePath}`).then((e) => e.data)
11
+ };
12
+ }
13
+ export { createPipelinesApi };
@@ -0,0 +1,4 @@
1
+ function createProcessorApi(e) {
2
+ return { runPipeline: (t) => e.post(`/api/v1/processor/run/${t.pipelineId}`, t.runPipelinePayloadDto, t.force === void 0 ? void 0 : { params: { force: t.force } }).then((e) => e.data) };
3
+ }
4
+ export { createProcessorApi };
@@ -0,0 +1,8 @@
1
+ function createWorkflowsApi(e) {
2
+ return {
3
+ getById: (t) => e.get(`/api/v1/workflows/${t.id}`).then((e) => e.data),
4
+ getAll: (t) => e.get("/api/v1/workflows", { params: t }).then((e) => e.data),
5
+ delete: (t) => e.delete(`/api/v1/workflows/${t.id}`).then((e) => e.data)
6
+ };
7
+ }
8
+ export { createWorkflowsApi };
@@ -0,0 +1,12 @@
1
+ function createWorkspacesApi(e) {
2
+ return {
3
+ getById: (t) => e.get(`/api/v1/workspaces/${t.id}`).then((e) => e.data),
4
+ getAll: (t) => e.get("/api/v1/workspaces", { params: t }).then((e) => e.data),
5
+ create: (t) => e.post("/api/v1/workspaces", t.workspaceCreateDto).then((e) => e.data),
6
+ update: (t) => e.put(`/api/v1/workspaces/${t.id}`, t.workspaceUpdateDto).then((e) => e.data),
7
+ delete: (t) => e.delete(`/api/v1/workspaces/id/${t.id}`).then((e) => e.data),
8
+ batchDelete: (t) => e.delete("/api/v1/workspaces/batch", { data: { ids: t.ids } }).then((e) => e.data),
9
+ setFavourite: (t) => e.patch(`/api/v1/workspaces/${t.id}/favourite`, t.workspaceFavouriteDto).then((e) => e.data)
10
+ };
11
+ }
12
+ export { createWorkspacesApi };
@@ -0,0 +1,35 @@
1
+ import { StudioProvider } from "../providers/StudioProvider.js";
2
+ import { SseProvider } from "../providers/SseProvider.js";
3
+ import { InvalidationEventsProvider } from "../providers/InvalidationEventsProvider.js";
4
+ import { useRouter } from "../routing/LocalRouter.js";
5
+ import LocalHealthCheck_default from "../features/health/LocalHealthCheck.js";
6
+ import { QueryProvider } from "../providers/QueryProvider.js";
7
+ import { c } from "react/compiler-runtime";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { Outlet, useSearchParams } from "react-router-dom";
10
+ function EnvironmentEmbedRoot() {
11
+ let f = c(14), [p] = useSearchParams(), m;
12
+ f[0] === p ? m = f[1] : (m = p.get("url") ?? "http://localhost:3080", f[0] = p, f[1] = m);
13
+ let h = m, g;
14
+ f[2] === p ? g = f[3] : (g = p.get("name") ?? "Preview Environment", f[2] = p, f[3] = g);
15
+ let _ = g, v;
16
+ f[4] !== _ || f[5] !== h ? (v = {
17
+ id: "preview-env",
18
+ name: _,
19
+ url: h
20
+ }, f[4] = _, f[5] = h, f[6] = v) : v = f[6];
21
+ let y = v, b = useRouter(y.id, "/embed/env"), x, S, C, w;
22
+ f[7] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ jsx(LocalHealthCheck_default, {}), S = /* @__PURE__ */ jsx(SseProvider, {}), C = /* @__PURE__ */ jsx(InvalidationEventsProvider, {}), w = /* @__PURE__ */ jsx(Outlet, {}), f[7] = x, f[8] = S, f[9] = C, f[10] = w) : (x = f[7], S = f[8], C = f[9], w = f[10]);
23
+ let T;
24
+ return f[11] !== y || f[12] !== b ? (T = /* @__PURE__ */ jsx(QueryProvider, { children: /* @__PURE__ */ jsxs(StudioProvider, {
25
+ router: b,
26
+ environment: y,
27
+ children: [
28
+ x,
29
+ S,
30
+ C,
31
+ w
32
+ ]
33
+ }) }), f[11] = y, f[12] = b, f[13] = T) : T = f[13], T;
34
+ }
35
+ export { EnvironmentEmbedRoot as default };
@@ -4,80 +4,91 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from ".
4
4
  import { c } from "react/compiler-runtime";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { X } from "lucide-react";
7
- var DataTableFilters_default = (m) => {
8
- let h = c(21), { filters: g, filterConfig: _, onFiltersChange: v, isOpen: y } = m;
9
- if (!y) return null;
10
- let b;
11
- h[0] !== g || h[1] !== v ? (b = (e, u) => {
12
- let d = { ...g };
13
- u === "all" ? delete d[e] : d[e] = u, v?.(d);
14
- }, h[0] = g, h[1] = v, h[2] = b) : b = h[2];
15
- let x = b, S;
16
- h[3] === v ? S = h[4] : (S = () => {
17
- v?.({});
18
- }, h[3] = v, h[4] = S);
7
+ function getOptionValue(e) {
8
+ return typeof e == "string" ? e : e.value;
9
+ }
10
+ function getOptionLabel(e) {
11
+ return typeof e == "string" ? e : e.label;
12
+ }
13
+ var DataTableFilters_default = (g) => {
14
+ let _ = c(20), { filters: v, filterConfig: y, onFiltersChange: b, isOpen: x } = g;
15
+ if (!x) return null;
16
+ let S;
17
+ _[0] !== v || _[1] !== b ? (S = (e, d) => {
18
+ let f = { ...v };
19
+ d === "all" ? delete f[e] : f[e] = d, b?.(f);
20
+ }, _[0] = v, _[1] = b, _[2] = S) : S = _[2];
19
21
  let C = S, w;
20
- h[5] === g ? w = h[6] : (w = Object.entries(g).filter(_temp), h[5] = g, h[6] = w);
21
- let T = w, E;
22
- h[7] !== _ || h[8] !== g || h[9] !== x ? (E = Object.entries(_).map((e) => {
23
- let [u, p] = e;
24
- return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(Select, {
25
- value: g[u] || "all",
26
- onValueChange: (e) => x(u, e),
27
- children: [/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, { placeholder: `Select ${u}` }) }), /* @__PURE__ */ jsxs(SelectContent, { children: [/* @__PURE__ */ jsxs(SelectItem, {
28
- value: "all",
29
- children: ["All ", u]
30
- }), p.map(_temp2)] })]
31
- }) }, u);
32
- }), h[7] = _, h[8] = g, h[9] = x, h[10] = E) : E = h[10];
33
- let D;
34
- h[11] !== T || h[12] !== x ? (D = T.length > 0 && /* @__PURE__ */ jsx("div", {
35
- className: "flex flex-wrap gap-2",
36
- children: T.map((e) => {
37
- let [d, f] = e;
38
- return /* @__PURE__ */ jsxs(Badge, {
39
- variant: "secondary",
40
- className: "flex items-center gap-1",
41
- children: [
42
- d,
43
- ": ",
44
- f,
45
- /* @__PURE__ */ jsx("button", {
46
- onClick: () => {
47
- x(d, "all");
48
- },
49
- children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3 cursor-pointer" })
50
- })
51
- ]
52
- }, d);
53
- })
54
- }), h[11] = T, h[12] = x, h[13] = D) : D = h[13];
55
- let O;
56
- h[14] !== T.length || h[15] !== C ? (O = T.length > 0 && /* @__PURE__ */ jsx(Button, {
22
+ _[3] === b ? w = _[4] : (w = () => {
23
+ b?.({});
24
+ }, _[3] = b, _[4] = w);
25
+ let T = w, E, D, O, k;
26
+ if (_[5] !== y || _[6] !== v || _[7] !== C) {
27
+ E = Object.entries(v).filter(_temp);
28
+ let e = (e, d) => {
29
+ let f = y[e];
30
+ if (!f) return d;
31
+ let p = f.find((e) => getOptionValue(e) === d);
32
+ return p ? getOptionLabel(p) : d;
33
+ };
34
+ D = "flex flex-wrap gap-4", O = Object.entries(y).map((e) => {
35
+ let [d, h] = e;
36
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(Select, {
37
+ value: v[d] || "all",
38
+ onValueChange: (e) => C(d, e),
39
+ children: [/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, { placeholder: `Select ${d}` }) }), /* @__PURE__ */ jsxs(SelectContent, { children: [/* @__PURE__ */ jsxs(SelectItem, {
40
+ value: "all",
41
+ children: ["All ", d]
42
+ }), h.map(_temp2)] })]
43
+ }) }, d);
44
+ }), k = E.length > 0 && /* @__PURE__ */ jsx("div", {
45
+ className: "flex flex-wrap gap-2",
46
+ children: E.map((f) => {
47
+ let [p, m] = f;
48
+ return /* @__PURE__ */ jsxs(Badge, {
49
+ variant: "secondary",
50
+ className: "flex items-center gap-1",
51
+ children: [
52
+ p,
53
+ ": ",
54
+ e(p, m),
55
+ /* @__PURE__ */ jsx("button", {
56
+ onClick: () => {
57
+ C(p, "all");
58
+ },
59
+ children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3 cursor-pointer" })
60
+ })
61
+ ]
62
+ }, p);
63
+ })
64
+ }), _[5] = y, _[6] = v, _[7] = C, _[8] = E, _[9] = D, _[10] = O, _[11] = k;
65
+ } else E = _[8], D = _[9], O = _[10], k = _[11];
66
+ let A;
67
+ _[12] !== E.length || _[13] !== T ? (A = E.length > 0 && /* @__PURE__ */ jsx(Button, {
57
68
  variant: "outline",
58
69
  size: "sm",
59
- onClick: C,
70
+ onClick: T,
60
71
  className: "ml-auto",
61
72
  children: "Clear All"
62
- }), h[14] = T.length, h[15] = C, h[16] = O) : O = h[16];
63
- let k;
64
- return h[17] !== E || h[18] !== D || h[19] !== O ? (k = /* @__PURE__ */ jsxs("div", {
65
- className: "flex flex-wrap gap-4",
73
+ }), _[12] = E.length, _[13] = T, _[14] = A) : A = _[14];
74
+ let j;
75
+ return _[15] !== D || _[16] !== O || _[17] !== k || _[18] !== A ? (j = /* @__PURE__ */ jsxs("div", {
76
+ className: D,
66
77
  children: [
67
- E,
68
- D,
69
- O
78
+ O,
79
+ k,
80
+ A
70
81
  ]
71
- }), h[17] = E, h[18] = D, h[19] = O, h[20] = k) : k = h[20], k;
82
+ }), _[15] = D, _[16] = O, _[17] = k, _[18] = A, _[19] = j) : j = _[19], j;
72
83
  };
73
84
  function _temp(e) {
74
- let [, u] = e;
75
- return u;
85
+ let [, d] = e;
86
+ return d;
76
87
  }
77
88
  function _temp2(e) {
78
89
  return /* @__PURE__ */ jsx(SelectItem, {
79
- value: e,
80
- children: e
81
- }, e);
90
+ value: getOptionValue(e),
91
+ children: getOptionLabel(e)
92
+ }, getOptionValue(e));
82
93
  }
83
94
  export { DataTableFilters_default as default };
@@ -0,0 +1,43 @@
1
+ import { Button } from "../ui/button.js";
2
+ import { Alert, AlertDescription, AlertTitle } from "../ui/alert.js";
3
+ import { Component } from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { AlertCircle } from "lucide-react";
6
+ var ErrorBoundary = class extends Component {
7
+ state = {
8
+ hasError: !1,
9
+ error: null
10
+ };
11
+ static getDerivedStateFromError(e) {
12
+ return {
13
+ hasError: !0,
14
+ error: e
15
+ };
16
+ }
17
+ componentDidCatch(e, c) {}
18
+ handleRetry = () => {
19
+ this.props.onRetry ? this.props.onRetry() : this.setState({
20
+ hasError: !1,
21
+ error: null
22
+ });
23
+ };
24
+ render() {
25
+ return this.state.hasError && this.state.error ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ jsxs("div", {
26
+ className: "flex min-h-[200px] flex-col items-center justify-center gap-4 p-6",
27
+ children: [/* @__PURE__ */ jsxs(Alert, {
28
+ variant: "destructive",
29
+ className: "max-w-lg",
30
+ children: [
31
+ /* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4" }),
32
+ /* @__PURE__ */ jsx(AlertTitle, { children: "Something went wrong" }),
33
+ /* @__PURE__ */ jsxs(AlertDescription, { children: [this.state.error.message, !1] })
34
+ ]
35
+ }), /* @__PURE__ */ jsx(Button, {
36
+ onClick: this.handleRetry,
37
+ variant: "outline",
38
+ children: "Try again"
39
+ })]
40
+ }) : this.props.children;
41
+ }
42
+ };
43
+ export { ErrorBoundary };
@@ -1,4 +1,4 @@
1
- import { cn } from "../lib/utils.js";
1
+ import { cn } from "../../lib/utils.js";
2
2
  import { c } from "react/compiler-runtime";
3
3
  import React from "react";
4
4
  import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
@@ -0,0 +1,5 @@
1
+ import { ErrorBoundary } from "./ErrorBoundary.js";
2
+ import LoadingCentered_default from "./LoadingCentered.js";
3
+ import Snackbar_default from "./Snackbar.js";
4
+ import ErrorSnackbar_default from "./ErrorSnackbar.js";
5
+ import ErrorAlert_default from "./ErrorAlert.js";
@@ -40,6 +40,9 @@ import { DataList } from "./data-table/DataList.js";
40
40
  import ListView_default from "./lists/ListView.js";
41
41
  import CustomListView_default from "./lists/CustomListView.js";
42
42
  import CompletionMessagePaper_default from "./messages/CompletionMessagePaper.js";
43
- import Snackbar_default from "./snackbars/Snackbar.js";
44
- import ErrorSnackbar_default from "./snackbars/ErrorSnackbar.js";
45
- import LoadingCentered_default from "./LoadingCentered.js";
43
+ import { ErrorBoundary } from "./feedback/ErrorBoundary.js";
44
+ import LoadingCentered_default from "./feedback/LoadingCentered.js";
45
+ import Snackbar_default from "./feedback/Snackbar.js";
46
+ import ErrorSnackbar_default from "./feedback/ErrorSnackbar.js";
47
+ import ErrorAlert_default from "./feedback/ErrorAlert.js";
48
+ import "./feedback/index.js";
@@ -1,23 +1,42 @@
1
+ import { Separator } from "../ui/separator.js";
2
+ import { SidebarTrigger, useSidebar } from "../ui/sidebar.js";
1
3
  import PageBreadcrumbs_default from "../page/PageBreadcrumbs.js";
2
4
  import { c } from "react/compiler-runtime";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- var MainLayout_default = (i) => {
5
- let a = c(10), { children: o, breadcrumbsData: s, headerMenu: l } = i, u;
6
- a[0] === s ? u = a[1] : (u = /* @__PURE__ */ jsx(PageBreadcrumbs_default, { breadcrumbData: s }), a[0] = s, a[1] = u);
7
- let d;
8
- a[2] !== l || a[3] !== u ? (d = /* @__PURE__ */ jsxs("div", {
9
- className: "flex min-h-[60px] items-center justify-between",
10
- children: [u, l]
11
- }), a[2] = l, a[3] = u, a[4] = d) : d = a[4];
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ var SidebarTriggerSafe = () => {
7
+ try {
8
+ return useSidebar(), /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SidebarTrigger, { className: "-ml-1" }), /* @__PURE__ */ jsx(Separator, {
9
+ orientation: "vertical",
10
+ className: "mr-2 data-[orientation=vertical]:h-4"
11
+ })] });
12
+ } catch {
13
+ return null;
14
+ }
15
+ }, MainLayout_default = (e) => {
16
+ let o = c(11), { children: s, breadcrumbsData: l, headerMenu: u } = e, d;
17
+ o[0] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ jsx(SidebarTriggerSafe, {}), o[0] = d) : d = o[0];
12
18
  let f;
13
- a[5] === o ? f = a[6] : (f = /* @__PURE__ */ jsx("div", {
14
- className: "space-y-6",
15
- children: o
16
- }), a[5] = o, a[6] = f);
19
+ o[1] === l ? f = o[2] : (f = /* @__PURE__ */ jsxs("div", {
20
+ className: "flex items-center gap-2",
21
+ children: [d, /* @__PURE__ */ jsx(PageBreadcrumbs_default, { breadcrumbData: l })]
22
+ }), o[1] = l, o[2] = f);
17
23
  let p;
18
- return a[7] !== d || a[8] !== f ? (p = /* @__PURE__ */ jsxs("div", {
19
- className: "px-4",
20
- children: [d, f]
21
- }), a[7] = d, a[8] = f, a[9] = p) : p = a[9], p;
24
+ o[3] !== u || o[4] !== f ? (p = /* @__PURE__ */ jsxs("div", {
25
+ className: "border-b flex h-12 shrink-0 items-center justify-between gap-2 px-4",
26
+ children: [f, u]
27
+ }), o[3] = u, o[4] = f, o[5] = p) : p = o[5];
28
+ let m;
29
+ o[6] === s ? m = o[7] : (m = /* @__PURE__ */ jsx("div", {
30
+ className: "flex-1 overflow-auto p-4",
31
+ children: /* @__PURE__ */ jsx("div", {
32
+ className: "space-y-6",
33
+ children: s
34
+ })
35
+ }), o[6] = s, o[7] = m);
36
+ let h;
37
+ return o[8] !== p || o[9] !== m ? (h = /* @__PURE__ */ jsxs("div", {
38
+ className: "flex h-full flex-col",
39
+ children: [p, m]
40
+ }), o[8] = p, o[9] = m, o[10] = h) : h = o[10], h;
22
41
  };
23
42
  export { MainLayout_default as default };
@@ -0,0 +1,165 @@
1
+ import { useStudio, useStudioOptional } from "../../providers/StudioProvider.js";
2
+ import { useFilterPipelines } from "../../hooks/usePipelines.js";
3
+ import { useComponentOverrides } from "../../providers/ComponentOverridesProvider.js";
4
+ import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarTrigger, useSidebar } from "../ui/sidebar.js";
5
+ import { c } from "react/compiler-runtime";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { Link, useLocation } from "react-router-dom";
8
+ import { CircleAlert, Info, LayoutDashboard, LayoutGrid, Play, Workflow } from "lucide-react";
9
+ var DefaultSidebarHeader = () => {
10
+ let e = c(5), { state: u } = useSidebar(), d;
11
+ e[0] === u ? d = e[1] : (d = u === "expanded" && /* @__PURE__ */ jsxs("div", {
12
+ className: "flex items-center gap-2 px-1.5",
13
+ children: [/* @__PURE__ */ jsx("img", {
14
+ src: "/loopstack.svg",
15
+ alt: "Loopstack",
16
+ className: "h-6 w-6"
17
+ }), /* @__PURE__ */ jsx("span", {
18
+ className: "text-sm font-semibold",
19
+ children: "Loopstack Studio"
20
+ })]
21
+ }), e[0] = u, e[1] = d);
22
+ let f;
23
+ e[2] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ jsx(SidebarTrigger, { className: "hover:cursor-pointer" }), e[2] = f) : f = e[2];
24
+ let p;
25
+ return e[3] === d ? p = e[4] : (p = /* @__PURE__ */ jsxs(SidebarHeader, {
26
+ className: "border-sidebar-border h-12 w-full flex-row items-center justify-between border-b px-1.5 py-0",
27
+ children: [d, f]
28
+ }), e[3] = d, e[4] = p), p;
29
+ }, RunsNav = () => {
30
+ let u = c(26), f = useLocation(), { router: p } = useStudio(), m = p.getRuns(), h;
31
+ u[0] === p ? h = u[1] : (h = p.getRunsActionRequired(), u[0] = p, u[1] = h);
32
+ let y = h, C;
33
+ u[2] === Symbol.for("react.memo_cache_sentinel") ? (C = {
34
+ parentId: null,
35
+ status: "paused"
36
+ }, u[2] = C) : C = u[2];
37
+ let w = useFilterPipelines(void 0, C, "createdAt", "DESC", 0, 1).data?.total ?? 0, T;
38
+ u[3] === Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Runs" }), u[3] = T) : T = u[3];
39
+ let E = f.pathname === m || f.pathname === m + "/", D, O;
40
+ u[4] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ jsx(Play, {}), O = /* @__PURE__ */ jsx("span", { children: "Overview" }), u[4] = D, u[5] = O) : (D = u[4], O = u[5]);
41
+ let k;
42
+ u[6] === m ? k = u[7] : (k = /* @__PURE__ */ jsxs(Link, {
43
+ to: m,
44
+ children: [D, O]
45
+ }), u[6] = m, u[7] = k);
46
+ let A;
47
+ u[8] !== E || u[9] !== k ? (A = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
48
+ asChild: !0,
49
+ isActive: E,
50
+ tooltip: "Overview",
51
+ children: k
52
+ }) }), u[8] = E, u[9] = k, u[10] = A) : A = u[10];
53
+ let j = f.pathname === y, M, N;
54
+ u[11] === Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ jsx(CircleAlert, {}), M = /* @__PURE__ */ jsx("span", { children: "Action Required" }), u[11] = M, u[12] = N) : (M = u[11], N = u[12]);
55
+ let P;
56
+ u[13] === y ? P = u[14] : (P = /* @__PURE__ */ jsxs(Link, {
57
+ to: y,
58
+ children: [N, M]
59
+ }), u[13] = y, u[14] = P);
60
+ let F;
61
+ u[15] !== P || u[16] !== j ? (F = /* @__PURE__ */ jsx(SidebarMenuButton, {
62
+ asChild: !0,
63
+ isActive: j,
64
+ tooltip: "Action Required",
65
+ children: P
66
+ }), u[15] = P, u[16] = j, u[17] = F) : F = u[17];
67
+ let I;
68
+ u[18] === w ? I = u[19] : (I = w > 0 && /* @__PURE__ */ jsx(SidebarMenuBadge, { children: w }), u[18] = w, u[19] = I);
69
+ let L;
70
+ u[20] !== F || u[21] !== I ? (L = /* @__PURE__ */ jsxs(SidebarMenuItem, { children: [F, I] }), u[20] = F, u[21] = I, u[22] = L) : L = u[22];
71
+ let R;
72
+ return u[23] !== L || u[24] !== A ? (R = /* @__PURE__ */ jsxs(SidebarGroup, { children: [T, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsxs(SidebarMenu, { children: [A, L] }) })] }), u[23] = L, u[24] = A, u[25] = R) : R = u[25], R;
73
+ }, WorkspacesNav = () => {
74
+ let u = c(11), d = useLocation(), { router: f } = useStudio(), p = f.getWorkspaces(), m;
75
+ u[0] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Workspaces" }), u[0] = m) : m = u[0];
76
+ let h;
77
+ u[1] !== d.pathname || u[2] !== p ? (h = d.pathname === p || d.pathname.startsWith(p + "/"), u[1] = d.pathname, u[2] = p, u[3] = h) : h = u[3];
78
+ let y, x;
79
+ u[4] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ jsx(LayoutGrid, {}), x = /* @__PURE__ */ jsx("span", { children: "My Workspaces" }), u[4] = y, u[5] = x) : (y = u[4], x = u[5]);
80
+ let C;
81
+ u[6] === p ? C = u[7] : (C = /* @__PURE__ */ jsxs(Link, {
82
+ to: p,
83
+ children: [y, x]
84
+ }), u[6] = p, u[7] = C);
85
+ let w;
86
+ return u[8] !== h || u[9] !== C ? (w = /* @__PURE__ */ jsxs(SidebarGroup, { children: [m, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
87
+ asChild: !0,
88
+ isActive: h,
89
+ tooltip: "My Workspaces",
90
+ children: C
91
+ }) }) }) })] }), u[8] = h, u[9] = C, u[10] = w) : w = u[10], w;
92
+ }, InsightsNav = () => {
93
+ let u = c(15), d = useLocation(), { router: f } = useStudio(), p;
94
+ u[0] === f ? p = u[1] : (p = f.getDashboard(), u[0] = f, u[1] = p);
95
+ let m;
96
+ u[2] === p ? m = u[3] : (m = {
97
+ label: "Dashboard",
98
+ href: p,
99
+ icon: LayoutDashboard
100
+ }, u[2] = p, u[3] = m);
101
+ let h;
102
+ u[4] === f ? h = u[5] : (h = f.getDebugWorkflows(), u[4] = f, u[5] = h);
103
+ let y;
104
+ u[6] === h ? y = u[7] : (y = {
105
+ label: "Workflows",
106
+ href: h,
107
+ icon: Workflow
108
+ }, u[6] = h, u[7] = y);
109
+ let x;
110
+ u[8] !== m || u[9] !== y ? (x = [m, y], u[8] = m, u[9] = y, u[10] = x) : x = u[10];
111
+ let C = x, w;
112
+ u[11] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Insights" }), u[11] = w) : w = u[11];
113
+ let T;
114
+ return u[12] !== d || u[13] !== C ? (T = /* @__PURE__ */ jsxs(SidebarGroup, { children: [w, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: C.map((e) => /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
115
+ asChild: !0,
116
+ isActive: d.pathname === e.href,
117
+ tooltip: e.label,
118
+ children: /* @__PURE__ */ jsxs(Link, {
119
+ to: e.href,
120
+ children: [/* @__PURE__ */ jsx(e.icon, {}), /* @__PURE__ */ jsx("span", { children: e.label })]
121
+ })
122
+ }) }, e.href)) }) })] }), u[12] = d, u[13] = C, u[14] = T) : T = u[14], T;
123
+ }, DefaultSidebarFooter = () => {
124
+ let u = c(9), d = useLocation(), { router: f } = useStudio(), p;
125
+ u[0] === f ? p = u[1] : (p = f.getEnvironmentInfo(), u[0] = f, u[1] = p);
126
+ let m = p, g = d.pathname === m, _, v;
127
+ u[2] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ jsx(Info, {}), v = /* @__PURE__ */ jsx("span", { children: "Info" }), u[2] = _, u[3] = v) : (_ = u[2], v = u[3]);
128
+ let y;
129
+ u[4] === m ? y = u[5] : (y = /* @__PURE__ */ jsxs(Link, {
130
+ to: m,
131
+ children: [_, v]
132
+ }), u[4] = m, u[5] = y);
133
+ let x;
134
+ return u[6] !== g || u[7] !== y ? (x = /* @__PURE__ */ jsx(SidebarFooter, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
135
+ asChild: !0,
136
+ isActive: g,
137
+ size: "sm",
138
+ tooltip: "Info",
139
+ children: y
140
+ }) }) }) }), u[6] = g, u[7] = y, u[8] = x) : x = u[8], x;
141
+ };
142
+ const StudioSidebar = () => {
143
+ let e = c(13), d = useComponentOverrides(), h = useStudioOptional(), g = d.SidebarHeader ?? DefaultSidebarHeader, _ = d.SidebarFooter ?? DefaultSidebarFooter, v;
144
+ e[0] === g ? v = e[1] : (v = /* @__PURE__ */ jsx(g, {}), e[0] = g, e[1] = v);
145
+ let y;
146
+ e[2] === h ? y = e[3] : (y = h && /* @__PURE__ */ jsxs(Fragment, { children: [
147
+ /* @__PURE__ */ jsx(RunsNav, {}),
148
+ /* @__PURE__ */ jsx(WorkspacesNav, {}),
149
+ /* @__PURE__ */ jsx(InsightsNav, {})
150
+ ] }), e[2] = h, e[3] = y);
151
+ let b;
152
+ e[4] === y ? b = e[5] : (b = /* @__PURE__ */ jsx(SidebarContent, { children: y }), e[4] = y, e[5] = b);
153
+ let x;
154
+ e[6] !== _ || e[7] !== h ? (x = h && /* @__PURE__ */ jsx(_, {}), e[6] = _, e[7] = h, e[8] = x) : x = e[8];
155
+ let S;
156
+ return e[9] !== v || e[10] !== b || e[11] !== x ? (S = /* @__PURE__ */ jsxs(Sidebar, {
157
+ collapsible: "icon",
158
+ children: [
159
+ v,
160
+ b,
161
+ x
162
+ ]
163
+ }), e[9] = v, e[10] = b, e[11] = x, e[12] = S) : S = e[12], S;
164
+ };
165
+ export { StudioSidebar };
@@ -10,7 +10,7 @@ var PageBreadcrumbs_default = (p) => {
10
10
  e.preventDefault(), _(d);
11
11
  }, m[0] = _, m[1] = v);
12
12
  let y = v, b;
13
- m[2] === g ? b = m[3] : (b = cn("ml-3 mb-2", g), m[2] = g, m[3] = b);
13
+ m[2] === g ? b = m[3] : (b = cn("ml-3", g), m[2] = g, m[3] = b);
14
14
  let x;
15
15
  if (m[4] !== h || m[5] !== y) {
16
16
  let e;