@loopstack/loopstack-studio 0.21.3 → 0.22.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 (86) 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 +33 -0
  13. package/dist/components/data-table/DataTableFilters.js +74 -63
  14. package/dist/components/layout/MainLayout.js +7 -4
  15. package/dist/components/page/PageBreadcrumbs.js +1 -1
  16. package/dist/components/ui/sidebar.js +359 -359
  17. package/dist/components/ui-widgets/UiActions.js +22 -15
  18. package/dist/components/ui-widgets/UiWidget.js +31 -26
  19. package/dist/components/ui-widgets/widgets/AiPromptInput.js +27 -27
  20. package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +12 -12
  21. package/dist/components/ui-widgets/widgets/SandboxRun.js +32 -0
  22. package/dist/components/ui-widgets/widgets/SubmitButton.js +11 -11
  23. package/dist/features/code-explorer/utils/fileIcons.js +4 -7
  24. package/dist/features/oauth/OAuthPromptRenderer.js +1 -1
  25. package/dist/features/runs/Runs.js +197 -0
  26. package/dist/features/workbench/NavigationItems.js +1 -1
  27. package/dist/features/workbench/Workbench.js +109 -75
  28. package/dist/features/workbench/WorkflowItem.js +8 -11
  29. package/dist/features/workbench/WorkflowList.js +29 -20
  30. package/dist/features/workbench/components/DocumentList.js +20 -20
  31. package/dist/features/workbench/components/NewRunDialog.js +328 -0
  32. package/dist/features/workbench/components/WorkbenchFloatingPanel.js +88 -0
  33. package/dist/features/workbench/components/WorkbenchFlowPanel.js +48 -0
  34. package/dist/features/workbench/components/WorkbenchIconSidebar.js +68 -0
  35. package/dist/features/workbench/components/WorkbenchPreviewPanel.js +128 -0
  36. package/dist/features/workbench/components/WorkflowForms.js +7 -6
  37. package/dist/features/workbench/components/WorkflowHistoryItem.js +68 -63
  38. package/dist/features/workbench/components/buttons/WorkflowButtons.js +79 -61
  39. package/dist/features/workbench/components/document-renderer/DocumentFormRenderer.js +6 -5
  40. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +77 -0
  41. package/dist/features/workspaces/Workspaces.js +2 -2
  42. package/dist/features/workspaces/components/CreateWorkspace.js +164 -81
  43. package/dist/features/workspaces/components/EnvironmentSlotSelector.js +63 -0
  44. package/dist/features/workspaces/components/ExecutionTimeline.js +69 -68
  45. package/dist/features/workspaces/components/PipelineForm.js +4 -4
  46. package/dist/hooks/index.js +2 -0
  47. package/dist/hooks/useApi.js +9 -33
  48. package/dist/hooks/useAuth.js +18 -38
  49. package/dist/hooks/useConfig.js +31 -33
  50. package/dist/hooks/useDashboard.js +1 -4
  51. package/dist/hooks/useDocuments.js +4 -8
  52. package/dist/hooks/useFiles.js +31 -41
  53. package/dist/hooks/useNamespaces.js +5 -8
  54. package/dist/hooks/usePipelines.js +98 -108
  55. package/dist/hooks/useProcessor.js +1 -4
  56. package/dist/hooks/useWorkflows.js +25 -41
  57. package/dist/hooks/useWorkspaces.js +45 -72
  58. package/dist/index.d.ts +266 -48
  59. package/dist/index.js +10 -2
  60. package/dist/packages/contracts/dist/enums/index.js +25 -0
  61. package/dist/packages/contracts/dist/enums/pipeline-state.js +10 -0
  62. package/dist/packages/contracts/dist/enums/registry.enum.js +20 -0
  63. package/dist/packages/contracts/dist/enums/sort-order.enum.js +10 -0
  64. package/dist/packages/contracts/dist/enums/user-type.enum.js +10 -0
  65. package/dist/packages/contracts/dist/enums/workflow-state.enum.js +10 -0
  66. package/dist/pages/DebugPage.js +12 -14
  67. package/dist/pages/DebugWorkflowDetailsPage.js +1 -1
  68. package/dist/pages/DebugWorkflowsPage.js +3 -4
  69. package/dist/pages/EmbedWorkbenchPage.js +4 -3
  70. package/dist/pages/PipelineDebugPage.js +2 -2
  71. package/dist/pages/PreviewWorkbenchPage.js +416 -0
  72. package/dist/pages/RunsListPage.js +36 -0
  73. package/dist/pages/RunsPage.js +49 -0
  74. package/dist/pages/StudioLandingPage.js +145 -0
  75. package/dist/pages/WorkbenchPage.js +75 -51
  76. package/dist/providers/InvalidationEventsProvider.js +7 -7
  77. package/dist/providers/QueryProvider.js +21 -0
  78. package/dist/routing/LocalRouter.js +9 -0
  79. package/dist/services/createApiClient.js +4 -10
  80. package/dist/services/index.js +1 -1
  81. package/package.json +2 -3
  82. package/dist/features/code-explorer/CodeExplorer.js +0 -69
  83. package/dist/features/code-explorer/components/CodeExplorerTree.js +0 -43
  84. package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +0 -82
  85. package/dist/features/workbench/components/WorkbenchSidebar.js +0 -109
  86. package/dist/features/workbench/providers/WorkbenchContextProvider.js +0 -3
@@ -1,20 +1,18 @@
1
1
  import { useStudio } from "../providers/StudioProvider.js";
2
- import { useApiClient } from "../hooks/useApi.js";
3
- import "../hooks/index.js";
4
2
  import { c } from "react/compiler-runtime";
5
3
  import { jsxs } from "react/jsx-runtime";
6
4
  var DebugPage_default = () => {
7
- let i = c(10), { environment: a } = useStudio(), { api: o } = useApiClient(), s = o?.ApiV1AuthApi, l = s ? s.basePath : void 0, u = a?.name, d;
8
- i[0] === u ? d = i[1] : (d = /* @__PURE__ */ jsxs("p", { children: ["Name: ", u] }), i[0] = u, i[1] = d);
9
- let f = a?.id, p;
10
- i[2] === f ? p = i[3] : (p = /* @__PURE__ */ jsxs("p", { children: ["Id: ", f] }), i[2] = f, i[3] = p);
11
- let m;
12
- i[4] === l ? m = i[5] : (m = /* @__PURE__ */ jsxs("p", { children: ["Base Path: ", l] }), i[4] = l, i[5] = m);
13
- let h;
14
- return i[6] !== d || i[7] !== p || i[8] !== m ? (h = /* @__PURE__ */ jsxs("div", { children: [
15
- d,
16
- p,
17
- m
18
- ] }), i[6] = d, i[7] = p, i[8] = m, i[9] = h) : h = i[9], h;
5
+ let r = c(10), { environment: i } = useStudio(), a = i?.name, o;
6
+ r[0] === a ? o = r[1] : (o = /* @__PURE__ */ jsxs("p", { children: ["Name: ", a] }), r[0] = a, r[1] = o);
7
+ let s = i?.id, l;
8
+ r[2] === s ? l = r[3] : (l = /* @__PURE__ */ jsxs("p", { children: ["Id: ", s] }), r[2] = s, r[3] = l);
9
+ let u = i?.url, d;
10
+ r[4] === u ? d = r[5] : (d = /* @__PURE__ */ jsxs("p", { children: ["URL: ", u] }), r[4] = u, r[5] = d);
11
+ let f;
12
+ return r[6] !== o || r[7] !== l || r[8] !== d ? (f = /* @__PURE__ */ jsxs("div", { children: [
13
+ o,
14
+ l,
15
+ d
16
+ ] }), r[6] = o, r[7] = l, r[8] = d, r[9] = f) : f = r[9], f;
19
17
  };
20
18
  export { DebugPage_default as default };
@@ -1,6 +1,6 @@
1
1
  import { useStudio } from "../providers/StudioProvider.js";
2
- import MainLayout_default from "../components/layout/MainLayout.js";
3
2
  import { usePipelineConfig, usePipelineSource } from "../hooks/usePipelines.js";
3
+ import MainLayout_default from "../components/layout/MainLayout.js";
4
4
  import { ReactFlowProvider } from "../node_modules/@xyflow/react/dist/esm/index.js";
5
5
  import ConfigFlowViewer_default from "../features/debug/components/ConfigFlowViewer.js";
6
6
  import { c } from "react/compiler-runtime";
@@ -1,9 +1,9 @@
1
1
  import { useStudio } from "../providers/StudioProvider.js";
2
2
  import { useApiClient } from "../hooks/useApi.js";
3
+ import { useWorkspaceConfig } from "../hooks/useConfig.js";
3
4
  import { Badge } from "../components/ui/badge.js";
4
5
  import MainLayout_default from "../components/layout/MainLayout.js";
5
6
  import { DataTable } from "../components/data-table/DataTable.js";
6
- import { useWorkspaceConfig } from "../hooks/useConfig.js";
7
7
  import { useMemo, useState } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { useQueries } from "@tanstack/react-query";
@@ -16,11 +16,10 @@ function DebugWorkflowsPage() {
16
16
  p
17
17
  ],
18
18
  queryFn: async () => {
19
- if (!m) throw Error("API not available");
20
- let c = await m.ApiV1ConfigApi.configControllerGetPipelineTypesByWorkspace({ workspaceBlockName: e.blockName });
19
+ let c = await m.config.getPipelineTypesByWorkspace({ workspaceBlockName: e.blockName });
21
20
  return {
22
21
  workspaceBlockName: e.blockName,
23
- types: c.data
22
+ types: c
24
23
  };
25
24
  },
26
25
  enabled: !!h?.length
@@ -1,14 +1,15 @@
1
+ import { usePipeline } from "../hooks/usePipelines.js";
1
2
  import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
2
3
  import ErrorSnackbar_default from "../components/snackbars/ErrorSnackbar.js";
3
4
  import LoadingCentered_default from "../components/LoadingCentered.js";
4
- import { usePipeline } from "../hooks/usePipelines.js";
5
+ import { require_enums } from "../packages/contracts/dist/enums/index.js";
5
6
  import WorkflowItem_default from "../features/workbench/WorkflowItem.js";
6
7
  import { requireParam } from "../lib/requireParam.js";
7
8
  import { c } from "react/compiler-runtime";
8
9
  import { useEffect, useRef } from "react";
9
10
  import { jsx, jsxs } from "react/jsx-runtime";
10
11
  import { useParams } from "react-router-dom";
11
- var EMBED_MESSAGE_TYPE = "loopstack:embed:workflow-completed", EMBED_RESIZE_MESSAGE_TYPE = "loopstack:embed:resize";
12
+ var import_enums = require_enums(), EMBED_MESSAGE_TYPE = "loopstack:embed:workflow-completed", EMBED_RESIZE_MESSAGE_TYPE = "loopstack:embed:resize";
12
13
  function EmbedWorkbenchPage() {
13
14
  let _ = c(24), v = useParams(), y;
14
15
  _[0] === v ? y = _[1] : (y = requireParam(v, "pipelineId"), _[0] = v, _[1] = y);
@@ -68,6 +69,6 @@ function EmbedWorkbenchPage() {
68
69
  }
69
70
  function _temp2() {}
70
71
  function _temp(t) {
71
- return t.status === "completed";
72
+ return t.status === import_enums.WorkflowState.Completed;
72
73
  }
73
74
  export { EmbedWorkbenchPage as default };
@@ -1,13 +1,13 @@
1
1
  import { useStudio } from "../providers/StudioProvider.js";
2
+ import { usePipeline, usePipelineConfig } from "../hooks/usePipelines.js";
2
3
  import { useWorkspace } from "../hooks/useWorkspaces.js";
3
4
  import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
4
5
  import MainLayout_default from "../components/layout/MainLayout.js";
5
6
  import ErrorSnackbar_default from "../components/snackbars/ErrorSnackbar.js";
6
- import { usePipeline, usePipelineConfig } from "../hooks/usePipelines.js";
7
7
  import { ReactFlowProvider } from "../node_modules/@xyflow/react/dist/esm/index.js";
8
+ import PipelineFlowViewer_default from "../features/debug/components/PipelineFlowViewer.js";
8
9
  import { requireParam } from "../lib/requireParam.js";
9
10
  import PipelineDebugHeader_default from "../features/debug/components/PipelineDebugHeader.js";
10
- import PipelineFlowViewer_default from "../features/debug/components/PipelineFlowViewer.js";
11
11
  import { c } from "react/compiler-runtime";
12
12
  import React, { useMemo } from "react";
13
13
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -0,0 +1,416 @@
1
+ import { useFilterPipelines, usePipeline, usePipelineConfig } from "../hooks/usePipelines.js";
2
+ import { useWorkspace } from "../hooks/useWorkspaces.js";
3
+ import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
4
+ import { Button } from "../components/ui/button.js";
5
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../components/ui/collapsible.js";
6
+ import { SidebarMenu, SidebarProvider } from "../components/ui/sidebar.js";
7
+ import ErrorSnackbar_default from "../components/snackbars/ErrorSnackbar.js";
8
+ import LoadingCentered_default from "../components/LoadingCentered.js";
9
+ import { require_enums } from "../packages/contracts/dist/enums/index.js";
10
+ import { ReactFlowProvider } from "../node_modules/@xyflow/react/dist/esm/index.js";
11
+ import WorkflowItem_default from "../features/workbench/WorkflowItem.js";
12
+ import WorkflowButtons_default from "../features/workbench/components/buttons/WorkflowButtons.js";
13
+ import { useNamespaceTree } from "../hooks/useNamespaceTree.js";
14
+ import WorkbenchNavigation_default from "../features/workbench/WorkbenchNavigation.js";
15
+ import PipelineHistoryList_default from "../features/workbench/components/PipelineHistoryList.js";
16
+ import PipelineFlowViewer_default from "../features/debug/components/PipelineFlowViewer.js";
17
+ import { NewRunDialog } from "../features/workbench/components/NewRunDialog.js";
18
+ import { c } from "react/compiler-runtime";
19
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
20
+ import { jsx, jsxs } from "react/jsx-runtime";
21
+ import { useNavigate, useParams } from "react-router-dom";
22
+ import { ChevronDown, ChevronRight, ListOrdered, Loader2, Navigation, Play, ScrollText, Workflow } from "lucide-react";
23
+ import { formatDistanceToNow } from "date-fns";
24
+ var import_enums = require_enums(), EMBED_MESSAGE_TYPE = "loopstack:embed:workflow-completed", EMBED_RESIZE_MESSAGE_TYPE = "loopstack:embed:resize", EMBED_NEW_RUN_MESSAGE_TYPE = "loopstack:embed:new-run";
25
+ function PreviewWorkbenchPage() {
26
+ let e = c(5), { pipelineId: t } = useParams(), [n, r] = useState(!1), i;
27
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = (e) => {
28
+ r(!1), window.parent !== window && window.parent.postMessage({
29
+ type: EMBED_NEW_RUN_MESSAGE_TYPE,
30
+ pipelineId: e
31
+ }, window.location.origin);
32
+ }, e[0] = i) : i = e[0];
33
+ let a = i;
34
+ if (!t) {
35
+ let t;
36
+ return e[1] === n ? t = e[2] : (t = /* @__PURE__ */ jsx(PreviewEmptyState, {
37
+ newRunDialogOpen: n,
38
+ onNewRunDialogOpenChange: r,
39
+ onNewRunSuccess: a
40
+ }), e[1] = n, e[2] = t), t;
41
+ }
42
+ let o;
43
+ return e[3] === t ? o = e[4] : (o = /* @__PURE__ */ jsx(PreviewWorkbenchContent, {
44
+ pipelineId: t,
45
+ onNewRunSuccess: a
46
+ }), e[3] = t, e[4] = o), o;
47
+ }
48
+ function PreviewWorkbenchContent(e) {
49
+ let o = c(57), { pipelineId: s, onNewRunSuccess: l } = e, u = useRef(null), [d, m] = useState("output"), [_, v] = useState(!1), y = usePipeline(s), S = useFetchWorkflowsByPipeline(s), w;
50
+ o[0] === S.data ? w = o[1] : (w = S.data ?? [], o[0] = S.data, o[1] = w);
51
+ let T = w, E = useRef(!1), ge = y.data?.workspaceId, D = useWorkspace(ge).data?.blockName, O = y.data?.blockName, k = usePipelineConfig(D, O), A, j;
52
+ o[2] !== S.data || o[3] !== s ? (A = () => {
53
+ !S.data || E.current || S.data.length > 0 && S.data.every(_temp) && window.parent !== window && (E.current = !0, window.parent.postMessage({
54
+ type: EMBED_MESSAGE_TYPE,
55
+ pipelineId: s
56
+ }, window.location.origin));
57
+ }, j = [S.data, s], o[2] = S.data, o[3] = s, o[4] = A, o[5] = j) : (A = o[4], j = o[5]), useEffect(A, j);
58
+ let M, N;
59
+ o[6] === s ? (M = o[7], N = o[8]) : (M = () => {
60
+ if (window.parent === window || !u.current) return;
61
+ let e = new ResizeObserver(() => {
62
+ if (!u.current) return;
63
+ let e = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
64
+ window.parent.postMessage({
65
+ type: EMBED_RESIZE_MESSAGE_TYPE,
66
+ pipelineId: s,
67
+ height: e
68
+ }, window.location.origin);
69
+ });
70
+ return e.observe(u.current), () => e.disconnect();
71
+ }, N = [s], o[6] = s, o[7] = M, o[8] = N), useEffect(M, N);
72
+ let P;
73
+ o[9] === l ? P = o[10] : (P = (e) => {
74
+ v(!1), l(e);
75
+ }, o[9] = l, o[10] = P);
76
+ let F = P, I = _temp2, L;
77
+ o[11] === Symbol.for("react.memo_cache_sentinel") ? (L = {
78
+ enableDebugMode: !1,
79
+ showFullMessageHistory: !1
80
+ }, o[11] = L) : L = o[11];
81
+ let R = L, z;
82
+ o[12] === Symbol.for("react.memo_cache_sentinel") ? (z = {
83
+ value: "output",
84
+ label: "Output",
85
+ icon: /* @__PURE__ */ jsx(ScrollText, { className: "h-3.5 w-3.5" })
86
+ }, o[12] = z) : z = o[12];
87
+ let B;
88
+ o[13] === Symbol.for("react.memo_cache_sentinel") ? (B = {
89
+ value: "graph",
90
+ label: "Graph",
91
+ icon: /* @__PURE__ */ jsx(Workflow, { className: "h-3.5 w-3.5" })
92
+ }, o[13] = B) : B = o[13];
93
+ let V;
94
+ o[14] === Symbol.for("react.memo_cache_sentinel") ? (V = [
95
+ z,
96
+ B,
97
+ {
98
+ value: "run-log",
99
+ label: "Run Log",
100
+ icon: /* @__PURE__ */ jsx(ListOrdered, { className: "h-3.5 w-3.5" })
101
+ }
102
+ ], o[14] = V) : V = o[14];
103
+ let _e = V, H;
104
+ o[15] === d ? H = o[16] : (H = /* @__PURE__ */ jsx("div", {
105
+ className: "bg-background flex items-center rounded-md border p-0.5",
106
+ children: _e.map((e) => /* @__PURE__ */ jsxs("button", {
107
+ onClick: () => m(e.value),
108
+ className: `flex items-center gap-1.5 rounded-sm px-2.5 py-1 text-xs font-medium transition-colors ${d === e.value ? "bg-foreground text-background shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
109
+ children: [e.icon, e.label]
110
+ }, e.value))
111
+ }), o[15] = d, o[16] = H);
112
+ let U;
113
+ o[17] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ jsxs(Button, {
114
+ variant: "outline",
115
+ size: "sm",
116
+ className: "h-7 gap-1.5",
117
+ onClick: () => v(!0),
118
+ children: [/* @__PURE__ */ jsx(Play, { className: "h-3 w-3" }), "New Run"]
119
+ }), o[17] = U) : U = o[17];
120
+ let W;
121
+ o[18] === H ? W = o[19] : (W = /* @__PURE__ */ jsxs("div", {
122
+ className: "bg-muted/50 flex h-11 shrink-0 items-center justify-between border-b px-3",
123
+ children: [H, U]
124
+ }), o[18] = H, o[19] = W);
125
+ let G;
126
+ o[20] === y.error ? G = o[21] : (G = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: y.error }), o[20] = y.error, o[21] = G);
127
+ let K;
128
+ o[22] === S.error ? K = o[23] : (K = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: S.error }), o[22] = S.error, o[23] = K);
129
+ let q;
130
+ o[24] !== d || o[25] !== y.data || o[26] !== y.isLoading || o[27] !== S.data || o[28] !== S.isLoading ? (q = d === "output" && /* @__PURE__ */ jsx("div", {
131
+ className: "px-4 py-3",
132
+ children: /* @__PURE__ */ jsx(LoadingCentered_default, {
133
+ loading: y.isLoading || S.isLoading,
134
+ children: y.data && S.data ? S.data.map((e) => /* @__PURE__ */ jsx(EmbedWorkflowSection, {
135
+ workflow: e,
136
+ pipeline: y.data,
137
+ collapsible: S.data.length > 1,
138
+ children: /* @__PURE__ */ jsx(WorkflowItem_default, {
139
+ pipeline: y.data,
140
+ workflowId: e.id,
141
+ scrollTo: I,
142
+ settings: R
143
+ })
144
+ }, e.id)) : null
145
+ })
146
+ }), o[24] = d, o[25] = y.data, o[26] = y.isLoading, o[27] = S.data, o[28] = S.isLoading, o[29] = q) : q = o[29];
147
+ let J;
148
+ o[30] !== d || o[31] !== y.isLoading || o[32] !== k || o[33] !== S.isLoading || o[34] !== s || o[35] !== T ? (J = d === "graph" && /* @__PURE__ */ jsx("div", {
149
+ className: "h-full",
150
+ children: /* @__PURE__ */ jsx(LoadingCentered_default, {
151
+ loading: y.isLoading || S.isLoading,
152
+ children: T.length > 0 ? /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(PipelineFlowViewer_default, {
153
+ pipelineId: s,
154
+ workflows: T,
155
+ pipelineConfig: k.data
156
+ }) }) : /* @__PURE__ */ jsx("div", {
157
+ className: "text-muted-foreground flex h-full items-center justify-center",
158
+ children: /* @__PURE__ */ jsx("p", {
159
+ className: "text-sm",
160
+ children: "No workflows found"
161
+ })
162
+ })
163
+ })
164
+ }), o[30] = d, o[31] = y.isLoading, o[32] = k, o[33] = S.isLoading, o[34] = s, o[35] = T, o[36] = J) : J = o[36];
165
+ let Y;
166
+ o[37] !== d || o[38] !== y.data ? (Y = d === "run-log" && /* @__PURE__ */ jsx("div", {
167
+ className: "px-4",
168
+ children: /* @__PURE__ */ jsx(PipelineHistoryList_default, { pipeline: y.data })
169
+ }), o[37] = d, o[38] = y.data, o[39] = Y) : Y = o[39];
170
+ let X;
171
+ o[40] !== d || o[41] !== s ? (X = d === "navigate" && /* @__PURE__ */ jsx("div", {
172
+ className: "px-4 py-2",
173
+ children: /* @__PURE__ */ jsx(EmbedNavigationContent, { pipelineId: s })
174
+ }), o[40] = d, o[41] = s, o[42] = X) : X = o[42];
175
+ let Z;
176
+ o[43] !== G || o[44] !== K || o[45] !== q || o[46] !== J || o[47] !== Y || o[48] !== X ? (Z = /* @__PURE__ */ jsxs("div", {
177
+ className: "flex-1 overflow-auto",
178
+ children: [
179
+ G,
180
+ K,
181
+ q,
182
+ J,
183
+ Y,
184
+ X
185
+ ]
186
+ }), o[43] = G, o[44] = K, o[45] = q, o[46] = J, o[47] = Y, o[48] = X, o[49] = Z) : Z = o[49];
187
+ let Q;
188
+ o[50] !== F || o[51] !== _ ? (Q = /* @__PURE__ */ jsx(NewRunDialog, {
189
+ open: _,
190
+ onOpenChange: v,
191
+ onSuccess: F
192
+ }), o[50] = F, o[51] = _, o[52] = Q) : Q = o[52];
193
+ let $;
194
+ return o[53] !== W || o[54] !== Z || o[55] !== Q ? ($ = /* @__PURE__ */ jsxs("div", {
195
+ ref: u,
196
+ className: "flex h-screen flex-col overflow-hidden",
197
+ children: [
198
+ W,
199
+ Z,
200
+ Q
201
+ ]
202
+ }), o[53] = W, o[54] = Z, o[55] = Q, o[56] = $) : $ = o[56], $;
203
+ }
204
+ function _temp2() {}
205
+ function _temp(e) {
206
+ return e.status === import_enums.WorkflowState.Completed;
207
+ }
208
+ var STATUS_DOT_COLORS = {
209
+ completed: "bg-green-500",
210
+ running: "bg-blue-500",
211
+ failed: "bg-red-500",
212
+ paused: "bg-yellow-500",
213
+ canceled: "bg-orange-500",
214
+ pending: "bg-muted-foreground"
215
+ };
216
+ function PreviewEmptyState(t) {
217
+ let n = c(23), { newRunDialogOpen: r, onNewRunDialogOpenChange: i, onNewRunSuccess: o } = t, s = useNavigate(), [l, u] = useState(3), d;
218
+ n[0] === Symbol.for("react.memo_cache_sentinel") ? (d = { parentId: null }, n[0] = d) : d = n[0];
219
+ let f = useFilterPipelines(void 0, d, "createdAt", "DESC", 0, l), p;
220
+ n[1] === f.data?.data ? p = n[2] : (p = f.data?.data ?? [], n[1] = f.data?.data, n[2] = p);
221
+ let m = p, h = f.data?.total ?? 0, g = m.length < h, _;
222
+ n[3] === i ? _ = n[4] : (_ = () => i(!0), n[3] = i, n[4] = _);
223
+ let v;
224
+ n[5] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ jsx(Play, { className: "h-3.5 w-3.5" }), n[5] = v) : v = n[5];
225
+ let y;
226
+ n[6] === _ ? y = n[7] : (y = /* @__PURE__ */ jsx("div", {
227
+ className: "flex justify-center",
228
+ children: /* @__PURE__ */ jsxs(Button, {
229
+ variant: "secondary",
230
+ size: "sm",
231
+ className: "gap-1.5",
232
+ onClick: _,
233
+ children: [v, "New Run"]
234
+ })
235
+ }), n[6] = _, n[7] = y);
236
+ let b;
237
+ n[8] !== f.isLoading || n[9] !== g || n[10] !== s || n[11] !== m ? (b = f.isLoading && m.length === 0 ? /* @__PURE__ */ jsx("div", {
238
+ className: "flex justify-center py-4",
239
+ children: /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground h-4 w-4 animate-spin" })
240
+ }) : m.length > 0 ? /* @__PURE__ */ jsxs("div", { children: [
241
+ /* @__PURE__ */ jsx("p", {
242
+ className: "text-muted-foreground mb-2 text-xs font-medium",
243
+ children: "Recent"
244
+ }),
245
+ /* @__PURE__ */ jsx("div", {
246
+ className: "max-h-[280px] overflow-auto",
247
+ children: /* @__PURE__ */ jsx("div", {
248
+ className: "divide-border divide-y",
249
+ children: m.map((e) => /* @__PURE__ */ jsx(RecentRunItem, {
250
+ pipeline: e,
251
+ onClick: () => void s(`/embed/preview/pipelines/${e.id}`)
252
+ }, e.id))
253
+ })
254
+ }),
255
+ g && /* @__PURE__ */ jsxs("button", {
256
+ className: "text-muted-foreground hover:text-foreground mt-2 flex w-full items-center justify-center gap-1 py-1 text-xs transition-colors",
257
+ onClick: () => u(_temp3),
258
+ children: [/* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" }), "Load more"]
259
+ })
260
+ ] }) : null, n[8] = f.isLoading, n[9] = g, n[10] = s, n[11] = m, n[12] = b) : b = n[12];
261
+ let x;
262
+ n[13] !== y || n[14] !== b ? (x = /* @__PURE__ */ jsxs("div", {
263
+ className: "w-full max-w-sm space-y-6 px-4",
264
+ children: [y, b]
265
+ }), n[13] = y, n[14] = b, n[15] = x) : x = n[15];
266
+ let S;
267
+ n[16] !== r || n[17] !== i || n[18] !== o ? (S = /* @__PURE__ */ jsx(NewRunDialog, {
268
+ open: r,
269
+ onOpenChange: i,
270
+ onSuccess: o
271
+ }), n[16] = r, n[17] = i, n[18] = o, n[19] = S) : S = n[19];
272
+ let C;
273
+ return n[20] !== x || n[21] !== S ? (C = /* @__PURE__ */ jsxs("div", {
274
+ className: "flex h-screen flex-col items-center justify-center",
275
+ children: [x, S]
276
+ }), n[20] = x, n[21] = S, n[22] = C) : C = n[22], C;
277
+ }
278
+ function _temp3(e) {
279
+ return e + 5;
280
+ }
281
+ function RecentRunItem(e) {
282
+ let t = c(17), { pipeline: n, onClick: r } = e, i = `h-1.5 w-1.5 shrink-0 rounded-full ${STATUS_DOT_COLORS[n.status] ?? "bg-muted-foreground"}`, a;
283
+ t[0] === i ? a = t[1] : (a = /* @__PURE__ */ jsx("span", { className: i }), t[0] = i, t[1] = a);
284
+ let o;
285
+ t[2] !== n.blockName || t[3] !== n.run ? (o = /* @__PURE__ */ jsxs("span", {
286
+ className: "truncate text-sm font-medium",
287
+ children: [
288
+ "Run #",
289
+ n.run,
290
+ " · ",
291
+ n.blockName
292
+ ]
293
+ }), t[2] = n.blockName, t[3] = n.run, t[4] = o) : o = t[4];
294
+ let s;
295
+ t[5] !== a || t[6] !== o ? (s = /* @__PURE__ */ jsxs("div", {
296
+ className: "flex items-center gap-2",
297
+ children: [a, o]
298
+ }), t[5] = a, t[6] = o, t[7] = s) : s = t[7];
299
+ let l = n.status, u;
300
+ t[8] === n.createdAt ? u = t[9] : (u = formatDistanceToNow(new Date(n.createdAt), { addSuffix: !0 }), t[8] = n.createdAt, t[9] = u);
301
+ let d;
302
+ t[10] !== n.status || t[11] !== u ? (d = /* @__PURE__ */ jsxs("p", {
303
+ className: "text-muted-foreground mt-0.5 pl-3.5 text-xs",
304
+ children: [
305
+ l,
306
+ " · ",
307
+ u
308
+ ]
309
+ }), t[10] = n.status, t[11] = u, t[12] = d) : d = t[12];
310
+ let f;
311
+ return t[13] !== r || t[14] !== s || t[15] !== d ? (f = /* @__PURE__ */ jsxs("button", {
312
+ className: "hover:bg-accent w-full rounded-md px-2 py-2.5 text-left transition-colors",
313
+ onClick: r,
314
+ children: [s, d]
315
+ }), t[13] = r, t[14] = s, t[15] = d, t[16] = f) : f = t[16], f;
316
+ }
317
+ function EmbedWorkflowSection(e) {
318
+ let t = c(29), { workflow: n, pipeline: r, collapsible: i, children: a } = e;
319
+ if (!i) {
320
+ let e;
321
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx(Play, { className: "text-primary h-3.5 w-3.5 fill-current" }), t[0] = e) : e = t[0];
322
+ let i = n.title ?? n.blockName, o;
323
+ t[1] === i ? o = t[2] : (o = /* @__PURE__ */ jsx("span", {
324
+ className: "flex-1 truncate text-sm",
325
+ children: i
326
+ }), t[1] = i, t[2] = o);
327
+ let s;
328
+ t[3] !== r || t[4] !== n.id ? (s = /* @__PURE__ */ jsx(WorkflowButtons_default, {
329
+ pipeline: r,
330
+ workflowId: n.id
331
+ }), t[3] = r, t[4] = n.id, t[5] = s) : s = t[5];
332
+ let l;
333
+ t[6] !== o || t[7] !== s ? (l = /* @__PURE__ */ jsxs("div", {
334
+ className: "flex items-center gap-2 p-2 text-sm font-medium",
335
+ children: [
336
+ e,
337
+ o,
338
+ s
339
+ ]
340
+ }), t[6] = o, t[7] = s, t[8] = l) : l = t[8];
341
+ let u;
342
+ t[9] === a ? u = t[10] : (u = /* @__PURE__ */ jsx("div", {
343
+ className: "py-1",
344
+ children: a
345
+ }), t[9] = a, t[10] = u);
346
+ let d;
347
+ return t[11] !== l || t[12] !== u ? (d = /* @__PURE__ */ jsxs("div", { children: [l, u] }), t[11] = l, t[12] = u, t[13] = d) : d = t[13], d;
348
+ }
349
+ let u;
350
+ t[14] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ jsx(Play, { className: "text-primary h-3.5 w-3.5 fill-current" }), t[14] = u) : u = t[14];
351
+ let d = n.title ?? n.blockName, f;
352
+ t[15] === d ? f = t[16] : (f = /* @__PURE__ */ jsx("span", {
353
+ className: "flex-1 truncate text-sm",
354
+ children: d
355
+ }), t[15] = d, t[16] = f);
356
+ let p;
357
+ t[17] !== r || t[18] !== n.id ? (p = /* @__PURE__ */ jsx(WorkflowButtons_default, {
358
+ pipeline: r,
359
+ workflowId: n.id
360
+ }), t[17] = r, t[18] = n.id, t[19] = p) : p = t[19];
361
+ let m;
362
+ t[20] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ jsx(ChevronRight, { className: "text-muted-foreground h-3.5 w-3.5 transition-transform group-data-[state=open]/collapsible:rotate-90" }), t[20] = m) : m = t[20];
363
+ let h;
364
+ t[21] !== f || t[22] !== p ? (h = /* @__PURE__ */ jsx(CollapsibleTrigger, {
365
+ asChild: !0,
366
+ children: /* @__PURE__ */ jsxs("button", {
367
+ className: "hover:bg-accent hover:text-accent-foreground group/trigger flex w-full items-center gap-2 rounded-md p-2 text-left text-sm font-medium",
368
+ children: [
369
+ u,
370
+ f,
371
+ p,
372
+ m
373
+ ]
374
+ })
375
+ }), t[21] = f, t[22] = p, t[23] = h) : h = t[23];
376
+ let g;
377
+ t[24] === a ? g = t[25] : (g = /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("div", {
378
+ className: "py-1",
379
+ children: a
380
+ }) }), t[24] = a, t[25] = g);
381
+ let v;
382
+ return t[26] !== h || t[27] !== g ? (v = /* @__PURE__ */ jsxs(Collapsible, {
383
+ defaultOpen: !0,
384
+ className: "group/collapsible",
385
+ children: [h, g]
386
+ }), t[26] = h, t[27] = g, t[28] = v) : v = t[28], v;
387
+ }
388
+ function EmbedNavigationContent(e) {
389
+ let t = c(4), { pipelineId: n } = e, r = useNamespaceTree(n);
390
+ if (!r || r.length === 0) {
391
+ let e;
392
+ return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsxs("div", {
393
+ className: "text-muted-foreground flex flex-col items-center justify-center gap-2 py-8",
394
+ children: [/* @__PURE__ */ jsx(Navigation, { className: "h-6 w-6" }), /* @__PURE__ */ jsx("span", {
395
+ className: "text-sm",
396
+ children: "No navigation items"
397
+ })]
398
+ }), t[0] = e) : e = t[0], e;
399
+ }
400
+ let i;
401
+ t[1] === Symbol.for("react.memo_cache_sentinel") ? (i = { "--sidebar-width": "100%" }, t[1] = i) : i = t[1];
402
+ let a;
403
+ return t[2] === r ? a = t[3] : (a = /* @__PURE__ */ jsx(SidebarProvider, {
404
+ defaultOpen: !0,
405
+ className: "min-h-0",
406
+ style: i,
407
+ children: /* @__PURE__ */ jsx("div", {
408
+ className: "w-full overflow-auto",
409
+ children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(WorkbenchNavigation_default, {
410
+ namespaceTree: r,
411
+ indent: 0
412
+ }) })
413
+ })
414
+ }), t[2] = r, t[3] = a), a;
415
+ }
416
+ export { PreviewWorkbenchPage as default };
@@ -0,0 +1,36 @@
1
+ import { useStudio } from "../providers/StudioProvider.js";
2
+ import MainLayout_default from "../components/layout/MainLayout.js";
3
+ import Runs_default from "../features/runs/Runs.js";
4
+ import { c } from "react/compiler-runtime";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Home } from "lucide-react";
7
+ function RunsListPage() {
8
+ let s = c(12), { router: l } = useStudio(), u;
9
+ s[0] === l ? u = s[1] : (u = l.getDashboard(), s[0] = l, s[1] = u);
10
+ let d;
11
+ s[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ jsx(Home, { className: "h-4 w-4" }), s[2] = d) : d = s[2];
12
+ let f;
13
+ s[3] === u ? f = s[4] : (f = {
14
+ label: "Dashboard",
15
+ href: u,
16
+ icon: d
17
+ }, s[3] = u, s[4] = f);
18
+ let p;
19
+ s[5] === Symbol.for("react.memo_cache_sentinel") ? (p = {
20
+ label: "Runs",
21
+ current: !0
22
+ }, s[5] = p) : p = s[5];
23
+ let m;
24
+ s[6] === f ? m = s[7] : (m = [f, p], s[6] = f, s[7] = m);
25
+ let h = m, g, _;
26
+ s[8] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx("h1", {
27
+ className: "mb-4 text-3xl font-bold tracking-tight",
28
+ children: "Runs"
29
+ }), _ = /* @__PURE__ */ jsx(Runs_default, {}), s[8] = g, s[9] = _) : (g = s[8], _ = s[9]);
30
+ let v;
31
+ return s[10] === h ? v = s[11] : (v = /* @__PURE__ */ jsxs(MainLayout_default, {
32
+ breadcrumbsData: h,
33
+ children: [g, _]
34
+ }), s[10] = h, s[11] = v), v;
35
+ }
36
+ export { RunsListPage as default };
@@ -0,0 +1,49 @@
1
+ import { useStudio } from "../providers/StudioProvider.js";
2
+ import MainLayout_default from "../components/layout/MainLayout.js";
3
+ import Runs_default from "../features/runs/Runs.js";
4
+ import { c } from "react/compiler-runtime";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Home } from "lucide-react";
7
+ function RunsPage() {
8
+ let s = c(17), { router: l } = useStudio(), u;
9
+ s[0] === l ? u = s[1] : (u = l.getDashboard(), s[0] = l, s[1] = u);
10
+ let d;
11
+ s[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ jsx(Home, { className: "h-4 w-4" }), s[2] = d) : d = s[2];
12
+ let f;
13
+ s[3] === u ? f = s[4] : (f = {
14
+ label: "Dashboard",
15
+ href: u,
16
+ icon: d
17
+ }, s[3] = u, s[4] = f);
18
+ let p;
19
+ s[5] === l ? p = s[6] : (p = l.getRuns(), s[5] = l, s[6] = p);
20
+ let m;
21
+ s[7] === p ? m = s[8] : (m = {
22
+ label: "Runs",
23
+ href: p
24
+ }, s[7] = p, s[8] = m);
25
+ let h;
26
+ s[9] === Symbol.for("react.memo_cache_sentinel") ? (h = {
27
+ label: "Action Required",
28
+ current: !0
29
+ }, s[9] = h) : h = s[9];
30
+ let g;
31
+ s[10] !== f || s[11] !== m ? (g = [
32
+ f,
33
+ m,
34
+ h
35
+ ], s[10] = f, s[11] = m, s[12] = g) : g = s[12];
36
+ let _ = g, v;
37
+ s[13] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ jsx("h1", {
38
+ className: "mb-4 text-3xl font-bold tracking-tight",
39
+ children: "Action Required"
40
+ }), s[13] = v) : v = s[13];
41
+ let y;
42
+ s[14] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ jsx(Runs_default, { defaultFilters: { status: "paused" } }), s[14] = y) : y = s[14];
43
+ let b;
44
+ return s[15] === _ ? b = s[16] : (b = /* @__PURE__ */ jsxs(MainLayout_default, {
45
+ breadcrumbsData: _,
46
+ children: [v, y]
47
+ }), s[15] = _, s[16] = b), b;
48
+ }
49
+ export { RunsPage as default };