@loopstack/loopstack-studio 0.23.1 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/dist/api/config.js +3 -3
  2. package/dist/api/index.js +10 -12
  3. package/dist/api/processor.js +1 -1
  4. package/dist/api/secrets.js +16 -0
  5. package/dist/api/workflows.js +7 -1
  6. package/dist/components/dynamic-form/ArrayController.js +68 -64
  7. package/dist/components/dynamic-form/CodeContent.js +3 -3
  8. package/dist/components/dynamic-form/Form.js +46 -40
  9. package/dist/components/dynamic-form/FormElement.js +1 -1
  10. package/dist/components/dynamic-form/FormElementHeader.js +2 -2
  11. package/dist/components/dynamic-form/ObjectController.js +24 -21
  12. package/dist/components/dynamic-form/fields/BaseFieldWrapper.js +1 -1
  13. package/dist/components/dynamic-form/fields/CodeViewField.js +36 -36
  14. package/dist/components/dynamic-form/fields/InputField.js +20 -19
  15. package/dist/components/dynamic-form/fields/RadioField.js +18 -18
  16. package/dist/components/dynamic-form/fields/SelectField.js +19 -19
  17. package/dist/components/dynamic-form/fields/TextareaField.js +17 -17
  18. package/dist/components/feedback/LoadingCentered.js +1 -1
  19. package/dist/components/layout/MainLayout.js +18 -31
  20. package/dist/components/layout/StudioSidebar.js +169 -109
  21. package/dist/components/loopstack-elements/link.js +77 -76
  22. package/dist/components/loopstack-elements/tool.js +171 -0
  23. package/dist/components/page/PageBreadcrumbs.js +79 -32
  24. package/dist/components/ui-widgets/UiActions.js +10 -4
  25. package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +8 -6
  26. package/dist/components/ui-widgets/widgets/SubmitButton.js +8 -6
  27. package/dist/features/code-explorer/components/FileContentViewer.js +92 -100
  28. package/dist/features/dashboard/RunItem.js +1 -1
  29. package/dist/features/debug/components/ConfigFlowViewer.js +2 -2
  30. package/dist/features/debug/components/{PipelineDebugHeader.js → WorkflowDebugHeader.js} +5 -5
  31. package/dist/features/debug/components/{PipelineDebugLegend.js → WorkflowDebugLegend.js} +2 -2
  32. package/dist/features/debug/components/{PipelineFlowViewer.js → WorkflowFlowViewer.js} +9 -9
  33. package/dist/features/debug/components/workflow-flow/WorkflowGraph.js +46 -0
  34. package/dist/features/debug/index.js +2 -2
  35. package/dist/features/debug/lib/flow-utils.js +142 -150
  36. package/dist/features/documents/DocumentRenderer.js +66 -30
  37. package/dist/features/documents/components/DocumentItem.js +2 -2
  38. package/dist/features/documents/components/DocumentList.js +18 -11
  39. package/dist/features/documents/document-details/DocumentDetails.js +4 -4
  40. package/dist/features/documents/renderers/AiMessage.js +12 -12
  41. package/dist/features/documents/renderers/ChoicesRenderer.js +92 -0
  42. package/dist/features/documents/renderers/ClaudeMessage.js +1 -1
  43. package/dist/features/documents/renderers/ConfirmPromptRenderer.js +56 -0
  44. package/dist/features/documents/renderers/DocumentFormRenderer.js +95 -65
  45. package/dist/features/documents/renderers/LinkMessageRenderer.js +8 -10
  46. package/dist/features/documents/renderers/SecretInputRenderer.js +87 -0
  47. package/dist/features/documents/renderers/TextPromptRenderer.js +57 -0
  48. package/dist/features/documents/renderers/useDocumentTransition.js +30 -0
  49. package/dist/features/oauth/OAuthPromptRenderer.js +20 -20
  50. package/dist/features/runs/Runs.js +8 -8
  51. package/dist/features/workbench/Workbench.js +35 -35
  52. package/dist/features/workbench/WorkflowItem.js +10 -9
  53. package/dist/features/workbench/WorkflowList.js +56 -73
  54. package/dist/features/workbench/components/NewRunDialog.js +18 -18
  55. package/dist/features/workbench/components/WorkbenchFilesPanel.js +33 -26
  56. package/dist/features/workbench/components/WorkbenchFloatingPanel.js +13 -44
  57. package/dist/features/workbench/components/WorkbenchFlowPanel.js +27 -29
  58. package/dist/features/workbench/components/WorkbenchIconSidebar.js +17 -17
  59. package/dist/features/workbench/components/WorkbenchPreviewPanel.js +2 -2
  60. package/dist/features/workbench/components/WorkbenchSecretsPanel.js +182 -0
  61. package/dist/features/workbench/components/WorkbenchSettingsModal.js +16 -41
  62. package/dist/features/workbench/components/WorkflowForms.js +14 -13
  63. package/dist/features/workbench/components/WorkflowHistoryItem.js +60 -81
  64. package/dist/features/workbench/components/{PipelineHistoryList.js → WorkflowHistoryList.js} +5 -5
  65. package/dist/features/workbench/components/buttons/WorkflowButtons.js +56 -54
  66. package/dist/features/workbench/hooks/useWorkflowData.js +10 -10
  67. package/dist/features/workbench/hooks/useWorkflowListState.js +8 -45
  68. package/dist/features/workbench/index.js +2 -3
  69. package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +132 -117
  70. package/dist/features/workbench/providers/ScrollProvider.js +2 -2
  71. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +4 -4
  72. package/dist/features/workspaces/Workspaces.js +1 -1
  73. package/dist/features/workspaces/components/CreateWorkspace.js +12 -12
  74. package/dist/features/workspaces/components/ExecutionTimeline.js +22 -21
  75. package/dist/features/workspaces/components/{NewPipelineRunDialog.js → NewWorkflowRunDialog.js} +6 -6
  76. package/dist/features/workspaces/components/{PipelineForm.js → WorkflowRunForm.js} +31 -31
  77. package/dist/features/workspaces/components/WorkspaceHomePage.js +11 -11
  78. package/dist/features/workspaces/components/{pipeline-form → workflow-form}/ArgumentsView.js +1 -1
  79. package/dist/features/workspaces/components/{pipeline-form → workflow-form}/SelectionView.js +16 -16
  80. package/dist/hooks/index.js +3 -3
  81. package/dist/hooks/query-keys.js +34 -68
  82. package/dist/hooks/useConfig.js +5 -5
  83. package/dist/hooks/useProcessor.js +5 -5
  84. package/dist/hooks/useSecrets.js +69 -0
  85. package/dist/hooks/useWorkflows.js +155 -68
  86. package/dist/index.d.ts +158 -116
  87. package/dist/index.js +5 -5
  88. package/dist/packages/contracts/dist/enums/index.js +11 -12
  89. package/dist/packages/contracts/dist/enums/workflow-state.enum.js +1 -1
  90. package/dist/pages/DashboardPage.js +87 -35
  91. package/dist/pages/DebugWorkflowDetailsPage.js +8 -8
  92. package/dist/pages/DebugWorkflowsPage.js +10 -10
  93. package/dist/pages/EmbedWorkbenchPage.js +39 -45
  94. package/dist/pages/PreviewWorkbenchPage.js +130 -255
  95. package/dist/pages/RunsListPage.js +1 -1
  96. package/dist/pages/StudioLandingPage.js +13 -13
  97. package/dist/pages/WorkbenchPage.js +6 -6
  98. package/dist/pages/WorkflowDebugPage.js +114 -0
  99. package/dist/pages/WorkspacePage.js +4 -2
  100. package/dist/providers/InvalidationEventsProvider.js +19 -19
  101. package/dist/providers/SseProvider.js +0 -1
  102. package/dist/routing/LocalRouter.js +14 -17
  103. package/dist/types/ai.types.js +13 -0
  104. package/package.json +2 -3
  105. package/dist/api/namespaces.js +0 -7
  106. package/dist/api/pipelines.js +0 -13
  107. package/dist/components/ai-elements/tool.js +0 -158
  108. package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +0 -41
  109. package/dist/features/workbench/NavigationItems.js +0 -52
  110. package/dist/features/workbench/WorkbenchNavigation.js +0 -38
  111. package/dist/features/workbench/components/NavigationItem.js +0 -68
  112. package/dist/features/workbench/hooks/useIntersectionObserver.js +0 -44
  113. package/dist/hooks/useNamespaceTree.js +0 -27
  114. package/dist/hooks/useNamespaces.js +0 -25
  115. package/dist/hooks/usePipelines.js +0 -161
  116. package/dist/node_modules/@ai-sdk/provider/dist/index.js +0 -65
  117. package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +0 -1008
  118. package/dist/node_modules/ai/dist/index.js +0 -1083
  119. package/dist/node_modules/zod/v3/ZodError.js +0 -79
  120. package/dist/node_modules/zod/v3/errors.js +0 -6
  121. package/dist/node_modules/zod/v3/helpers/errorUtil.js +0 -5
  122. package/dist/node_modules/zod/v3/helpers/parseUtil.js +0 -90
  123. package/dist/node_modules/zod/v3/helpers/util.js +0 -72
  124. package/dist/node_modules/zod/v3/locales/en.js +0 -58
  125. package/dist/node_modules/zod/v3/types.js +0 -2425
  126. package/dist/node_modules/zod/v4/classic/errors.js +0 -21
  127. package/dist/node_modules/zod/v4/classic/iso.js +0 -29
  128. package/dist/node_modules/zod/v4/classic/parse.js +0 -4
  129. package/dist/node_modules/zod/v4/classic/schemas.js +0 -392
  130. package/dist/node_modules/zod/v4/core/api.js +0 -532
  131. package/dist/node_modules/zod/v4/core/checks.js +0 -283
  132. package/dist/node_modules/zod/v4/core/core.js +0 -44
  133. package/dist/node_modules/zod/v4/core/doc.js +0 -21
  134. package/dist/node_modules/zod/v4/core/errors.js +0 -40
  135. package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -305
  136. package/dist/node_modules/zod/v4/core/parse.js +0 -66
  137. package/dist/node_modules/zod/v4/core/regexes.js +0 -28
  138. package/dist/node_modules/zod/v4/core/registries.js +0 -38
  139. package/dist/node_modules/zod/v4/core/schemas.js +0 -863
  140. package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -220
  141. package/dist/node_modules/zod/v4/core/util.js +0 -267
  142. package/dist/node_modules/zod/v4/core/versions.js +0 -6
  143. package/dist/packages/contracts/dist/enums/pipeline-state.js +0 -10
  144. package/dist/pages/PipelineDebugPage.js +0 -115
  145. /package/dist/features/debug/components/{pipeline-flow → workflow-flow}/StateNode.js +0 -0
  146. /package/dist/features/debug/components/{pipeline-flow → workflow-flow}/WorkflowTransitionEdge.js +0 -0
  147. /package/dist/features/workspaces/components/{pipeline-form → workflow-form}/HeaderSection.js +0 -0
@@ -1,21 +1,14 @@
1
1
  import { useStudio } from "../providers/StudioProvider.js";
2
- import { useFilterPipelines, usePipeline, usePipelineConfigByName } from "../hooks/usePipelines.js";
3
- import { useWorkspace } from "../hooks/useWorkspaces.js";
2
+ import { useFilterWorkflows, useWorkflow, useWorkflowConfigByName } from "../hooks/useWorkflows.js";
4
3
  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
4
  import LoadingCentered_default from "../components/feedback/LoadingCentered.js";
8
5
  import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
9
6
  import { require_enums } from "../packages/contracts/dist/enums/index.js";
10
- import { useFetchWorkflowsByPipeline } from "../hooks/useWorkflows.js";
11
7
  import WorkflowItem_default from "../features/workbench/WorkflowItem.js";
12
- import WorkflowButtons_default from "../features/workbench/components/buttons/WorkflowButtons.js";
13
8
  import { ReactFlowProvider } from "../node_modules/@xyflow/react/dist/esm/index.js";
14
- import PipelineFlowViewer_default from "../features/debug/components/PipelineFlowViewer.js";
9
+ import WorkflowFlowViewer_default from "../features/debug/components/WorkflowFlowViewer.js";
15
10
  import "../features/debug/index.js";
16
- import { useNamespaceTree } from "../hooks/useNamespaceTree.js";
17
- import WorkbenchNavigation_default from "../features/workbench/WorkbenchNavigation.js";
18
- import PipelineHistoryList_default from "../features/workbench/components/PipelineHistoryList.js";
11
+ import WorkflowHistoryList_default from "../features/workbench/components/WorkflowHistoryList.js";
19
12
  import { NewRunDialog } from "../features/workbench/components/NewRunDialog.js";
20
13
  import "../features/workbench/index.js";
21
14
  import { c } from "react/compiler-runtime";
@@ -23,15 +16,15 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
23
16
  import { jsx, jsxs } from "react/jsx-runtime";
24
17
  import { useQuery } from "@tanstack/react-query";
25
18
  import { useNavigate, useParams } from "react-router-dom";
26
- import { ChevronDown, ChevronRight, ListOrdered, Loader2, Navigation, Play, RefreshCw, ScrollText, Workflow } from "lucide-react";
19
+ import { ChevronDown, ListOrdered, Loader2, Play, RefreshCw, ScrollText, Workflow } from "lucide-react";
27
20
  import { formatDistanceToNow } from "date-fns";
28
21
  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";
29
22
  function PreviewWorkbenchPage() {
30
- let e = c(5), { pipelineId: t } = useParams(), [n, r] = useState(!1), i;
23
+ let e = c(5), { workflowId: t } = useParams(), [n, r] = useState(!1), i;
31
24
  e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = (e) => {
32
25
  r(!1), window.parent !== window && window.parent.postMessage({
33
26
  type: EMBED_NEW_RUN_MESSAGE_TYPE,
34
- pipelineId: e
27
+ workflowId: e
35
28
  }, window.location.origin);
36
29
  }, e[0] = i) : i = e[0];
37
30
  let a = i;
@@ -45,125 +38,116 @@ function PreviewWorkbenchPage() {
45
38
  }
46
39
  let o;
47
40
  return e[3] === t ? o = e[4] : (o = /* @__PURE__ */ jsx(PreviewWorkbenchContent, {
48
- pipelineId: t,
41
+ workflowId: t,
49
42
  onNewRunSuccess: a
50
43
  }), e[3] = t, e[4] = o), o;
51
44
  }
52
45
  function PreviewWorkbenchContent(e) {
53
- let t = c(61), { pipelineId: o, onNewRunSuccess: s } = e, l = useRef(null), [u, d] = useState("output"), [m, _] = useState(!1), b = usePipeline(o), x = useFetchWorkflowsByPipeline(o), C;
54
- t[0] === x.data ? C = t[1] : (C = x.data ?? [], t[0] = x.data, t[1] = C);
55
- let T = C, E = useRef(!1), _e = b.data?.workspaceId, ve = useWorkspace(_e).data?.blockName, ye = b.data?.blockName, D = usePipelineConfigByName(ve, ye), O, k;
56
- t[2] !== x.data || t[3] !== o ? (O = () => {
57
- !x.data || E.current || x.data.length > 0 && x.data.every(_temp) && window.parent !== window && (E.current = !0, window.parent.postMessage({
46
+ let t = c(49), { workflowId: s, onNewRunSuccess: m } = e, g = useRef(null), [v, ce] = useState("output"), [y, b] = useState(!1), S = useWorkflow(s), C = useRef(!1), E = useWorkflowConfigByName(S.data?.className ?? void 0), k, A;
47
+ t[0] !== S.data || t[1] !== s ? (k = () => {
48
+ !S.data || C.current || S.data.status === import_enums.WorkflowState.Completed && window.parent !== window && (C.current = !0, window.parent.postMessage({
58
49
  type: EMBED_MESSAGE_TYPE,
59
- pipelineId: o
50
+ workflowId: s
60
51
  }, window.location.origin));
61
- }, k = [x.data, o], t[2] = x.data, t[3] = o, t[4] = O, t[5] = k) : (O = t[4], k = t[5]), useEffect(O, k);
62
- let A, j;
63
- t[6] === o ? (A = t[7], j = t[8]) : (A = () => {
64
- if (window.parent === window || !l.current) return;
52
+ }, A = [S.data, s], t[0] = S.data, t[1] = s, t[2] = k, t[3] = A) : (k = t[2], A = t[3]), useEffect(k, A);
53
+ let j, M;
54
+ t[4] === s ? (j = t[5], M = t[6]) : (j = () => {
55
+ if (window.parent === window || !g.current) return;
65
56
  let e = new ResizeObserver(() => {
66
- if (!l.current) return;
57
+ if (!g.current) return;
67
58
  let e = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
68
59
  window.parent.postMessage({
69
60
  type: EMBED_RESIZE_MESSAGE_TYPE,
70
- pipelineId: o,
61
+ workflowId: s,
71
62
  height: e
72
63
  }, window.location.origin);
73
64
  });
74
- return e.observe(l.current), () => e.disconnect();
75
- }, j = [o], t[6] = o, t[7] = A, t[8] = j), useEffect(A, j);
76
- let M;
77
- t[9] === s ? M = t[10] : (M = (e) => {
78
- _(!1), s(e);
79
- }, t[9] = s, t[10] = M);
80
- let N = M, P = _temp2, F;
81
- t[11] === Symbol.for("react.memo_cache_sentinel") ? (F = {
65
+ return e.observe(g.current), () => e.disconnect();
66
+ }, M = [s], t[4] = s, t[5] = j, t[6] = M), useEffect(j, M);
67
+ let N;
68
+ t[7] === m ? N = t[8] : (N = (e) => {
69
+ b(!1), m(e);
70
+ }, t[7] = m, t[8] = N);
71
+ let P = N, F = _temp, I;
72
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (I = {
82
73
  enableDebugMode: !1,
83
74
  showFullMessageHistory: !1
84
- }, t[11] = F) : F = t[11];
85
- let I = F, L;
86
- t[12] === Symbol.for("react.memo_cache_sentinel") ? (L = {
75
+ }, t[9] = I) : I = t[9];
76
+ let L = I, R;
77
+ t[10] === Symbol.for("react.memo_cache_sentinel") ? (R = {
87
78
  value: "output",
88
79
  label: "Output",
89
80
  icon: /* @__PURE__ */ jsx(ScrollText, { className: "h-3.5 w-3.5" })
90
- }, t[12] = L) : L = t[12];
91
- let R;
92
- t[13] === Symbol.for("react.memo_cache_sentinel") ? (R = {
81
+ }, t[10] = R) : R = t[10];
82
+ let z;
83
+ t[11] === Symbol.for("react.memo_cache_sentinel") ? (z = {
93
84
  value: "graph",
94
85
  label: "Graph",
95
86
  icon: /* @__PURE__ */ jsx(Workflow, { className: "h-3.5 w-3.5" })
96
- }, t[13] = R) : R = t[13];
97
- let z;
98
- t[14] === Symbol.for("react.memo_cache_sentinel") ? (z = {
87
+ }, t[11] = z) : z = t[11];
88
+ let B;
89
+ t[12] === Symbol.for("react.memo_cache_sentinel") ? (B = {
99
90
  value: "run-log",
100
91
  label: "Run Log",
101
92
  icon: /* @__PURE__ */ jsx(ListOrdered, { className: "h-3.5 w-3.5" })
102
- }, t[14] = z) : z = t[14];
103
- let B;
104
- t[15] === Symbol.for("react.memo_cache_sentinel") ? (B = [
105
- L,
93
+ }, t[12] = B) : B = t[12];
94
+ let V;
95
+ t[13] === Symbol.for("react.memo_cache_sentinel") ? (V = [
106
96
  R,
107
97
  z,
98
+ B,
108
99
  {
109
100
  value: "logs",
110
101
  label: "Logs",
111
102
  icon: /* @__PURE__ */ jsx(ScrollText, { className: "h-3.5 w-3.5" })
112
103
  }
113
- ], t[15] = B) : B = t[15];
114
- let be = B, V;
115
- t[16] === u ? V = t[17] : (V = /* @__PURE__ */ jsx("div", {
104
+ ], t[13] = V) : V = t[13];
105
+ let H = V, U;
106
+ t[14] === v ? U = t[15] : (U = /* @__PURE__ */ jsx("div", {
116
107
  className: "bg-background flex items-center rounded-md border p-0.5",
117
- children: be.map((e) => /* @__PURE__ */ jsxs("button", {
118
- onClick: () => d(e.value),
119
- className: `flex items-center gap-1.5 rounded-sm px-2.5 py-1 text-xs font-medium transition-colors ${u === e.value ? "bg-foreground text-background shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
108
+ children: H.map((e) => /* @__PURE__ */ jsxs("button", {
109
+ onClick: () => ce(e.value),
110
+ className: `flex items-center gap-1.5 rounded-sm px-2.5 py-1 text-xs font-medium transition-colors ${v === e.value ? "bg-foreground text-background shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
120
111
  children: [e.icon, e.label]
121
112
  }, e.value))
122
- }), t[16] = u, t[17] = V);
123
- let H;
124
- t[18] === Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ jsxs(Button, {
113
+ }), t[14] = v, t[15] = U);
114
+ let W;
115
+ t[16] === Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ jsxs(Button, {
125
116
  variant: "outline",
126
117
  size: "sm",
127
118
  className: "h-7 gap-1.5",
128
- onClick: () => _(!0),
119
+ onClick: () => b(!0),
129
120
  children: [/* @__PURE__ */ jsx(Play, { className: "h-3 w-3" }), "New Run"]
130
- }), t[18] = H) : H = t[18];
131
- let U;
132
- t[19] === V ? U = t[20] : (U = /* @__PURE__ */ jsxs("div", {
133
- className: "bg-muted/50 flex h-11 shrink-0 items-center justify-between border-b px-3",
134
- children: [V, H]
135
- }), t[19] = V, t[20] = U);
136
- let W;
137
- t[21] === b.error ? W = t[22] : (W = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: b.error }), t[21] = b.error, t[22] = W);
121
+ }), t[16] = W) : W = t[16];
138
122
  let G;
139
- t[23] === x.error ? G = t[24] : (G = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: x.error }), t[23] = x.error, t[24] = G);
123
+ t[17] === U ? G = t[18] : (G = /* @__PURE__ */ jsxs("div", {
124
+ className: "bg-muted/50 flex h-11 shrink-0 items-center justify-between border-b px-3",
125
+ children: [U, W]
126
+ }), t[17] = U, t[18] = G);
140
127
  let K;
141
- t[25] !== u || t[26] !== b.data || t[27] !== b.isLoading || t[28] !== x.data || t[29] !== x.isLoading ? (K = u === "output" && /* @__PURE__ */ jsx("div", {
128
+ t[19] === S.error ? K = t[20] : (K = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: S.error }), t[19] = S.error, t[20] = K);
129
+ let q;
130
+ t[21] !== v || t[22] !== S.data || t[23] !== S.isLoading ? (q = v === "output" && /* @__PURE__ */ jsx("div", {
142
131
  className: "px-4 py-3",
143
132
  children: /* @__PURE__ */ jsx(LoadingCentered_default, {
144
- loading: b.isLoading || x.isLoading,
145
- children: b.data && x.data ? x.data.map((e) => /* @__PURE__ */ jsx(EmbedWorkflowSection, {
146
- workflow: e,
147
- pipeline: b.data,
148
- collapsible: x.data.length > 1,
149
- children: /* @__PURE__ */ jsx(WorkflowItem_default, {
150
- pipeline: b.data,
151
- workflowId: e.id,
152
- scrollTo: P,
153
- settings: I
154
- })
155
- }, e.id)) : null
133
+ loading: S.isLoading,
134
+ children: S.data ? /* @__PURE__ */ jsx(WorkflowItem_default, {
135
+ workflow: S.data,
136
+ workflowId: S.data.id,
137
+ scrollTo: F,
138
+ settings: L
139
+ }) : null
156
140
  })
157
- }), t[25] = u, t[26] = b.data, t[27] = b.isLoading, t[28] = x.data, t[29] = x.isLoading, t[30] = K) : K = t[30];
158
- let q;
159
- t[31] !== u || t[32] !== b.isLoading || t[33] !== D || t[34] !== x.isLoading || t[35] !== o || t[36] !== T ? (q = u === "graph" && /* @__PURE__ */ jsx("div", {
141
+ }), t[21] = v, t[22] = S.data, t[23] = S.isLoading, t[24] = q) : q = t[24];
142
+ let J;
143
+ t[25] !== v || t[26] !== S.data || t[27] !== S.isLoading || t[28] !== E || t[29] !== s ? (J = v === "graph" && /* @__PURE__ */ jsx("div", {
160
144
  className: "h-full",
161
145
  children: /* @__PURE__ */ jsx(LoadingCentered_default, {
162
- loading: b.isLoading || x.isLoading,
163
- children: T.length > 0 ? /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(PipelineFlowViewer_default, {
164
- pipelineId: o,
165
- workflows: T,
166
- pipelineConfig: D.data,
146
+ loading: S.isLoading,
147
+ children: S.data ? /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(WorkflowFlowViewer_default, {
148
+ workflowId: s,
149
+ workflows: [S.data],
150
+ workflowConfig: E.data,
167
151
  direction: "TB"
168
152
  }) }) : /* @__PURE__ */ jsx("div", {
169
153
  className: "text-muted-foreground flex h-full items-center justify-center",
@@ -173,53 +157,43 @@ function PreviewWorkbenchContent(e) {
173
157
  })
174
158
  })
175
159
  })
176
- }), t[31] = u, t[32] = b.isLoading, t[33] = D, t[34] = x.isLoading, t[35] = o, t[36] = T, t[37] = q) : q = t[37];
177
- let J;
178
- t[38] !== u || t[39] !== b.data ? (J = u === "run-log" && /* @__PURE__ */ jsx("div", {
179
- className: "px-4",
180
- children: /* @__PURE__ */ jsx(PipelineHistoryList_default, { pipeline: b.data })
181
- }), t[38] = u, t[39] = b.data, t[40] = J) : J = t[40];
160
+ }), t[25] = v, t[26] = S.data, t[27] = S.isLoading, t[28] = E, t[29] = s, t[30] = J) : J = t[30];
182
161
  let Y;
183
- t[41] !== u || t[42] !== o ? (Y = u === "navigate" && /* @__PURE__ */ jsx("div", {
184
- className: "px-4 py-2",
185
- children: /* @__PURE__ */ jsx(EmbedNavigationContent, { pipelineId: o })
186
- }), t[41] = u, t[42] = o, t[43] = Y) : Y = t[43];
162
+ t[31] !== v || t[32] !== S.data ? (Y = v === "run-log" && /* @__PURE__ */ jsx("div", {
163
+ className: "px-4",
164
+ children: /* @__PURE__ */ jsx(WorkflowHistoryList_default, { workflow: S.data })
165
+ }), t[31] = v, t[32] = S.data, t[33] = Y) : Y = t[33];
187
166
  let X;
188
- t[44] === u ? X = t[45] : (X = u === "logs" && /* @__PURE__ */ jsx(EmbedLogsContent, {}), t[44] = u, t[45] = X);
167
+ t[34] === v ? X = t[35] : (X = v === "logs" && /* @__PURE__ */ jsx(EmbedLogsContent, {}), t[34] = v, t[35] = X);
189
168
  let Z;
190
- t[46] !== W || t[47] !== G || t[48] !== K || t[49] !== q || t[50] !== J || t[51] !== Y || t[52] !== X ? (Z = /* @__PURE__ */ jsxs("div", {
169
+ t[36] !== K || t[37] !== q || t[38] !== J || t[39] !== Y || t[40] !== X ? (Z = /* @__PURE__ */ jsxs("div", {
191
170
  className: "flex-1 overflow-auto",
192
171
  children: [
193
- W,
194
- G,
195
172
  K,
196
173
  q,
197
174
  J,
198
175
  Y,
199
176
  X
200
177
  ]
201
- }), t[46] = W, t[47] = G, t[48] = K, t[49] = q, t[50] = J, t[51] = Y, t[52] = X, t[53] = Z) : Z = t[53];
178
+ }), t[36] = K, t[37] = q, t[38] = J, t[39] = Y, t[40] = X, t[41] = Z) : Z = t[41];
202
179
  let Q;
203
- t[54] !== N || t[55] !== m ? (Q = /* @__PURE__ */ jsx(NewRunDialog, {
204
- open: m,
205
- onOpenChange: _,
206
- onSuccess: N
207
- }), t[54] = N, t[55] = m, t[56] = Q) : Q = t[56];
180
+ t[42] !== P || t[43] !== y ? (Q = /* @__PURE__ */ jsx(NewRunDialog, {
181
+ open: y,
182
+ onOpenChange: b,
183
+ onSuccess: P
184
+ }), t[42] = P, t[43] = y, t[44] = Q) : Q = t[44];
208
185
  let $;
209
- return t[57] !== U || t[58] !== Z || t[59] !== Q ? ($ = /* @__PURE__ */ jsxs("div", {
210
- ref: l,
186
+ return t[45] !== G || t[46] !== Z || t[47] !== Q ? ($ = /* @__PURE__ */ jsxs("div", {
187
+ ref: g,
211
188
  className: "flex h-screen flex-col overflow-hidden",
212
189
  children: [
213
- U,
190
+ G,
214
191
  Z,
215
192
  Q
216
193
  ]
217
- }), t[57] = U, t[58] = Z, t[59] = Q, t[60] = $) : $ = t[60], $;
218
- }
219
- function _temp2() {}
220
- function _temp(e) {
221
- return e.status === import_enums.WorkflowState.Completed;
194
+ }), t[45] = G, t[46] = Z, t[47] = Q, t[48] = $) : $ = t[48], $;
222
195
  }
196
+ function _temp() {}
223
197
  var STATUS_DOT_COLORS = {
224
198
  completed: "bg-green-500",
225
199
  running: "bg-blue-500",
@@ -229,30 +203,30 @@ var STATUS_DOT_COLORS = {
229
203
  pending: "bg-muted-foreground"
230
204
  };
231
205
  function PreviewEmptyState(n) {
232
- let r = c(24), { newRunDialogOpen: i, onNewRunDialogOpenChange: o, onNewRunSuccess: s } = n, l = useNavigate(), { router: u } = useStudio(), [d, f] = useState(3), p;
233
- r[0] === Symbol.for("react.memo_cache_sentinel") ? (p = { parentId: null }, r[0] = p) : p = r[0];
234
- let m = useFilterPipelines(void 0, p, "createdAt", "DESC", 0, d), h;
235
- r[1] === m.data?.data ? h = r[2] : (h = m.data?.data ?? [], r[1] = m.data?.data, r[2] = h);
236
- let g = h, _ = m.data?.total ?? 0, v = g.length < _, y;
237
- r[3] === o ? y = r[4] : (y = () => o(!0), r[3] = o, r[4] = y);
238
- let b;
239
- r[5] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ jsx(Play, { className: "h-3.5 w-3.5" }), r[5] = b) : b = r[5];
240
- let x;
241
- r[6] === y ? x = r[7] : (x = /* @__PURE__ */ jsx("div", {
206
+ let r = c(24), { newRunDialogOpen: a, onNewRunDialogOpenChange: o, onNewRunSuccess: s } = n, l = useNavigate(), { router: u } = useStudio(), [d, f] = useState(3), m;
207
+ r[0] === Symbol.for("react.memo_cache_sentinel") ? (m = { parentId: null }, r[0] = m) : m = r[0];
208
+ let h = useFilterWorkflows(void 0, m, "createdAt", "DESC", 0, d), g;
209
+ r[1] === h.data?.data ? g = r[2] : (g = h.data?.data ?? [], r[1] = h.data?.data, r[2] = g);
210
+ let _ = g, v = h.data?.total ?? 0, y = _.length < v, x;
211
+ r[3] === o ? x = r[4] : (x = () => o(!0), r[3] = o, r[4] = x);
212
+ let C;
213
+ r[5] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(Play, { className: "h-3.5 w-3.5" }), r[5] = C) : C = r[5];
214
+ let w;
215
+ r[6] === x ? w = r[7] : (w = /* @__PURE__ */ jsx("div", {
242
216
  className: "flex justify-center",
243
217
  children: /* @__PURE__ */ jsxs(Button, {
244
218
  variant: "secondary",
245
219
  size: "sm",
246
220
  className: "gap-1.5",
247
- onClick: y,
248
- children: [b, "New Run"]
221
+ onClick: x,
222
+ children: [C, "New Run"]
249
223
  })
250
- }), r[6] = y, r[7] = x);
251
- let S;
252
- r[8] !== m.isLoading || r[9] !== v || r[10] !== l || r[11] !== g || r[12] !== u ? (S = m.isLoading && g.length === 0 ? /* @__PURE__ */ jsx("div", {
224
+ }), r[6] = x, r[7] = w);
225
+ let T;
226
+ r[8] !== h.isLoading || r[9] !== y || r[10] !== l || r[11] !== u || r[12] !== _ ? (T = h.isLoading && _.length === 0 ? /* @__PURE__ */ jsx("div", {
253
227
  className: "flex justify-center py-4",
254
228
  children: /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground h-4 w-4 animate-spin" })
255
- }) : g.length > 0 ? /* @__PURE__ */ jsxs("div", { children: [
229
+ }) : _.length > 0 ? /* @__PURE__ */ jsxs("div", { children: [
256
230
  /* @__PURE__ */ jsx("p", {
257
231
  className: "text-muted-foreground mb-2 text-xs font-medium",
258
232
  children: "Recent"
@@ -261,51 +235,51 @@ function PreviewEmptyState(n) {
261
235
  className: "max-h-[280px] overflow-auto",
262
236
  children: /* @__PURE__ */ jsx("div", {
263
237
  className: "divide-border divide-y",
264
- children: g.map((e) => /* @__PURE__ */ jsx(RecentRunItem, {
265
- pipeline: e,
266
- onClick: () => void l(u.getPreviewPipeline(e.id))
238
+ children: _.map((e) => /* @__PURE__ */ jsx(RecentRunItem, {
239
+ workflow: e,
240
+ onClick: () => void l(u.getPreviewWorkflow(e.id))
267
241
  }, e.id))
268
242
  })
269
243
  }),
270
- v && /* @__PURE__ */ jsxs("button", {
244
+ y && /* @__PURE__ */ jsxs("button", {
271
245
  className: "text-muted-foreground hover:text-foreground mt-2 flex w-full items-center justify-center gap-1 py-1 text-xs transition-colors",
272
- onClick: () => f(_temp3),
246
+ onClick: () => f(_temp2),
273
247
  children: [/* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" }), "Load more"]
274
248
  })
275
- ] }) : null, r[8] = m.isLoading, r[9] = v, r[10] = l, r[11] = g, r[12] = u, r[13] = S) : S = r[13];
276
- let C;
277
- r[14] !== x || r[15] !== S ? (C = /* @__PURE__ */ jsxs("div", {
249
+ ] }) : null, r[8] = h.isLoading, r[9] = y, r[10] = l, r[11] = u, r[12] = _, r[13] = T) : T = r[13];
250
+ let E;
251
+ r[14] !== w || r[15] !== T ? (E = /* @__PURE__ */ jsxs("div", {
278
252
  className: "w-full max-w-sm space-y-6 px-4",
279
- children: [x, S]
280
- }), r[14] = x, r[15] = S, r[16] = C) : C = r[16];
281
- let w;
282
- r[17] !== i || r[18] !== o || r[19] !== s ? (w = /* @__PURE__ */ jsx(NewRunDialog, {
283
- open: i,
253
+ children: [w, T]
254
+ }), r[14] = w, r[15] = T, r[16] = E) : E = r[16];
255
+ let D;
256
+ r[17] !== a || r[18] !== o || r[19] !== s ? (D = /* @__PURE__ */ jsx(NewRunDialog, {
257
+ open: a,
284
258
  onOpenChange: o,
285
259
  onSuccess: s
286
- }), r[17] = i, r[18] = o, r[19] = s, r[20] = w) : w = r[20];
287
- let T;
288
- return r[21] !== C || r[22] !== w ? (T = /* @__PURE__ */ jsxs("div", {
260
+ }), r[17] = a, r[18] = o, r[19] = s, r[20] = D) : D = r[20];
261
+ let O;
262
+ return r[21] !== E || r[22] !== D ? (O = /* @__PURE__ */ jsxs("div", {
289
263
  className: "flex h-screen flex-col items-center justify-center",
290
- children: [C, w]
291
- }), r[21] = C, r[22] = w, r[23] = T) : T = r[23], T;
264
+ children: [E, D]
265
+ }), r[21] = E, r[22] = D, r[23] = O) : O = r[23], O;
292
266
  }
293
- function _temp3(e) {
267
+ function _temp2(e) {
294
268
  return e + 5;
295
269
  }
296
270
  function RecentRunItem(e) {
297
- 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;
271
+ let t = c(17), { workflow: n, onClick: r } = e, i = `h-1.5 w-1.5 shrink-0 rounded-full ${STATUS_DOT_COLORS[n.status] ?? "bg-muted-foreground"}`, a;
298
272
  t[0] === i ? a = t[1] : (a = /* @__PURE__ */ jsx("span", { className: i }), t[0] = i, t[1] = a);
299
273
  let o;
300
- t[2] !== n.blockName || t[3] !== n.run ? (o = /* @__PURE__ */ jsxs("span", {
274
+ t[2] !== n.alias || t[3] !== n.run ? (o = /* @__PURE__ */ jsxs("span", {
301
275
  className: "truncate text-sm font-medium",
302
276
  children: [
303
277
  "Run #",
304
278
  n.run,
305
279
  " · ",
306
- n.blockName
280
+ n.alias
307
281
  ]
308
- }), t[2] = n.blockName, t[3] = n.run, t[4] = o) : o = t[4];
282
+ }), t[2] = n.alias, t[3] = n.run, t[4] = o) : o = t[4];
309
283
  let s;
310
284
  t[5] !== a || t[6] !== o ? (s = /* @__PURE__ */ jsxs("div", {
311
285
  className: "flex items-center gap-2",
@@ -314,14 +288,14 @@ function RecentRunItem(e) {
314
288
  let l = n.status, u;
315
289
  t[8] === n.createdAt ? u = t[9] : (u = formatDistanceToNow(new Date(n.createdAt), { addSuffix: !0 }), t[8] = n.createdAt, t[9] = u);
316
290
  let d;
317
- t[10] !== n.status || t[11] !== u ? (d = /* @__PURE__ */ jsxs("p", {
291
+ t[10] !== u || t[11] !== n.status ? (d = /* @__PURE__ */ jsxs("p", {
318
292
  className: "text-muted-foreground mt-0.5 pl-3.5 text-xs",
319
293
  children: [
320
294
  l,
321
295
  " · ",
322
296
  u
323
297
  ]
324
- }), t[10] = n.status, t[11] = u, t[12] = d) : d = t[12];
298
+ }), t[10] = u, t[11] = n.status, t[12] = d) : d = t[12];
325
299
  let f;
326
300
  return t[13] !== r || t[14] !== s || t[15] !== d ? (f = /* @__PURE__ */ jsxs("button", {
327
301
  className: "hover:bg-accent w-full rounded-md px-2 py-2.5 text-left transition-colors",
@@ -329,77 +303,6 @@ function RecentRunItem(e) {
329
303
  children: [s, d]
330
304
  }), t[13] = r, t[14] = s, t[15] = d, t[16] = f) : f = t[16], f;
331
305
  }
332
- function EmbedWorkflowSection(e) {
333
- let t = c(29), { workflow: n, pipeline: r, collapsible: i, children: a } = e;
334
- if (!i) {
335
- let e;
336
- 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];
337
- let i = n.title ?? n.blockName, o;
338
- t[1] === i ? o = t[2] : (o = /* @__PURE__ */ jsx("span", {
339
- className: "flex-1 truncate text-sm",
340
- children: i
341
- }), t[1] = i, t[2] = o);
342
- let s;
343
- t[3] !== r || t[4] !== n.id ? (s = /* @__PURE__ */ jsx(WorkflowButtons_default, {
344
- pipeline: r,
345
- workflowId: n.id
346
- }), t[3] = r, t[4] = n.id, t[5] = s) : s = t[5];
347
- let l;
348
- t[6] !== o || t[7] !== s ? (l = /* @__PURE__ */ jsxs("div", {
349
- className: "flex items-center gap-2 p-2 text-sm font-medium",
350
- children: [
351
- e,
352
- o,
353
- s
354
- ]
355
- }), t[6] = o, t[7] = s, t[8] = l) : l = t[8];
356
- let u;
357
- t[9] === a ? u = t[10] : (u = /* @__PURE__ */ jsx("div", {
358
- className: "py-1",
359
- children: a
360
- }), t[9] = a, t[10] = u);
361
- let d;
362
- 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;
363
- }
364
- let u;
365
- 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];
366
- let d = n.title ?? n.blockName, f;
367
- t[15] === d ? f = t[16] : (f = /* @__PURE__ */ jsx("span", {
368
- className: "flex-1 truncate text-sm",
369
- children: d
370
- }), t[15] = d, t[16] = f);
371
- let p;
372
- t[17] !== r || t[18] !== n.id ? (p = /* @__PURE__ */ jsx(WorkflowButtons_default, {
373
- pipeline: r,
374
- workflowId: n.id
375
- }), t[17] = r, t[18] = n.id, t[19] = p) : p = t[19];
376
- let m;
377
- 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];
378
- let h;
379
- t[21] !== f || t[22] !== p ? (h = /* @__PURE__ */ jsx(CollapsibleTrigger, {
380
- asChild: !0,
381
- children: /* @__PURE__ */ jsxs("button", {
382
- 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",
383
- children: [
384
- u,
385
- f,
386
- p,
387
- m
388
- ]
389
- })
390
- }), t[21] = f, t[22] = p, t[23] = h) : h = t[23];
391
- let g;
392
- t[24] === a ? g = t[25] : (g = /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx("div", {
393
- className: "py-1",
394
- children: a
395
- }) }), t[24] = a, t[25] = g);
396
- let v;
397
- return t[26] !== h || t[27] !== g ? (v = /* @__PURE__ */ jsxs(Collapsible, {
398
- defaultOpen: !0,
399
- className: "group/collapsible",
400
- children: [h, g]
401
- }), t[26] = h, t[27] = g, t[28] = v) : v = t[28], v;
402
- }
403
306
  function stripAnsi(e) {
404
307
  return e.replace(/\x1b\[[0-9;]*m/g, "");
405
308
  }
@@ -485,32 +388,4 @@ function EmbedLogsContent() {
485
388
  })]
486
389
  });
487
390
  }
488
- function EmbedNavigationContent(e) {
489
- let t = c(4), { pipelineId: n } = e, r = useNamespaceTree(n);
490
- if (!r || r.length === 0) {
491
- let e;
492
- return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsxs("div", {
493
- className: "text-muted-foreground flex flex-col items-center justify-center gap-2 py-8",
494
- children: [/* @__PURE__ */ jsx(Navigation, { className: "h-6 w-6" }), /* @__PURE__ */ jsx("span", {
495
- className: "text-sm",
496
- children: "No navigation items"
497
- })]
498
- }), t[0] = e) : e = t[0], e;
499
- }
500
- let i;
501
- t[1] === Symbol.for("react.memo_cache_sentinel") ? (i = { "--sidebar-width": "100%" }, t[1] = i) : i = t[1];
502
- let a;
503
- return t[2] === r ? a = t[3] : (a = /* @__PURE__ */ jsx(SidebarProvider, {
504
- defaultOpen: !0,
505
- className: "min-h-0",
506
- style: i,
507
- children: /* @__PURE__ */ jsx("div", {
508
- className: "w-full overflow-auto",
509
- children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(WorkbenchNavigation_default, {
510
- namespaceTree: r,
511
- indent: 0
512
- }) })
513
- })
514
- }), t[2] = r, t[3] = a), a;
515
- }
516
391
  export { PreviewWorkbenchPage as default };
@@ -43,7 +43,7 @@ function RunsListPage() {
43
43
  }), w = /* @__PURE__ */ jsx(Runs_default, {}), f[9] = C, f[10] = w) : (C = f[9], w = f[10]);
44
44
  let T;
45
45
  f[11] === p ? T = f[12] : (T = (r) => {
46
- h(!1), p.navigateToPipeline(r);
46
+ h(!1), p.navigateToWorkflow(r);
47
47
  }, f[11] = p, f[12] = T);
48
48
  let E;
49
49
  f[13] !== m || f[14] !== T ? (E = /* @__PURE__ */ jsx(NewRunDialog, {