@loopstack/loopstack-studio 0.24.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/api/config.js +3 -3
  2. package/dist/api/index.js +9 -13
  3. package/dist/api/processor.js +1 -1
  4. package/dist/api/workflows.js +7 -1
  5. package/dist/components/dynamic-form/CodeContent.js +3 -3
  6. package/dist/components/dynamic-form/fields/CodeViewField.js +36 -36
  7. package/dist/components/feedback/LoadingCentered.js +1 -1
  8. package/dist/components/layout/StudioSidebar.js +2 -2
  9. package/dist/components/loopstack-elements/link.js +77 -76
  10. package/dist/components/loopstack-elements/tool.js +171 -0
  11. package/dist/components/ui-widgets/UiActions.js +10 -4
  12. package/dist/components/ui-widgets/UiWidget.js +27 -36
  13. package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +8 -6
  14. package/dist/components/ui-widgets/widgets/SubmitButton.js +8 -6
  15. package/dist/features/code-explorer/components/FileContentViewer.js +87 -112
  16. package/dist/features/dashboard/RunItem.js +1 -1
  17. package/dist/features/debug/components/ConfigFlowViewer.js +2 -2
  18. package/dist/features/debug/components/{PipelineDebugHeader.js → WorkflowDebugHeader.js} +5 -5
  19. package/dist/features/debug/components/{PipelineDebugLegend.js → WorkflowDebugLegend.js} +2 -2
  20. package/dist/features/debug/components/{PipelineFlowViewer.js → WorkflowFlowViewer.js} +9 -9
  21. package/dist/features/debug/components/workflow-flow/WorkflowGraph.js +46 -0
  22. package/dist/features/debug/index.js +2 -2
  23. package/dist/features/debug/lib/flow-utils.js +142 -150
  24. package/dist/features/documents/DocumentRenderer.js +66 -30
  25. package/dist/features/documents/components/DocumentItem.js +2 -2
  26. package/dist/features/documents/components/DocumentList.js +15 -12
  27. package/dist/features/documents/document-details/DocumentDetails.js +4 -4
  28. package/dist/features/documents/renderers/AiMessage.js +1 -1
  29. package/dist/features/documents/renderers/ChoicesRenderer.js +92 -0
  30. package/dist/features/documents/renderers/ClaudeMessage.js +1 -1
  31. package/dist/features/documents/renderers/ConfirmPromptRenderer.js +56 -0
  32. package/dist/features/documents/renderers/DocumentFormRenderer.js +95 -71
  33. package/dist/features/documents/renderers/LinkMessageRenderer.js +8 -10
  34. package/dist/features/documents/renderers/SecretInputRenderer.js +87 -0
  35. package/dist/features/documents/renderers/TextPromptRenderer.js +57 -0
  36. package/dist/features/documents/renderers/useDocumentTransition.js +30 -0
  37. package/dist/features/oauth/OAuthPromptRenderer.js +20 -20
  38. package/dist/features/runs/Runs.js +8 -8
  39. package/dist/features/workbench/Workbench.js +35 -35
  40. package/dist/features/workbench/WorkflowItem.js +10 -9
  41. package/dist/features/workbench/WorkflowList.js +56 -73
  42. package/dist/features/workbench/components/NewRunDialog.js +18 -18
  43. package/dist/features/workbench/components/WorkbenchFilesPanel.js +1 -1
  44. package/dist/features/workbench/components/WorkbenchFloatingPanel.js +33 -72
  45. package/dist/features/workbench/components/WorkbenchFlowPanel.js +27 -29
  46. package/dist/features/workbench/components/WorkbenchIconSidebar.js +30 -42
  47. package/dist/features/workbench/components/WorkbenchPreviewPanel.js +2 -2
  48. package/dist/features/workbench/components/WorkbenchSecretsPanel.js +1 -1
  49. package/dist/features/workbench/components/WorkbenchSettingsModal.js +16 -41
  50. package/dist/features/workbench/components/WorkflowForms.js +14 -13
  51. package/dist/features/workbench/components/WorkflowHistoryItem.js +60 -81
  52. package/dist/features/workbench/components/{PipelineHistoryList.js → WorkflowHistoryList.js} +5 -5
  53. package/dist/features/workbench/components/buttons/WorkflowButtons.js +56 -54
  54. package/dist/features/workbench/hooks/useWorkflowData.js +10 -10
  55. package/dist/features/workbench/hooks/useWorkflowListState.js +8 -45
  56. package/dist/features/workbench/index.js +2 -3
  57. package/dist/features/workbench/providers/ScrollProvider.js +2 -2
  58. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +4 -4
  59. package/dist/features/workspaces/Workspaces.js +1 -1
  60. package/dist/features/workspaces/components/CreateWorkspace.js +12 -12
  61. package/dist/features/workspaces/components/ExecutionTimeline.js +22 -21
  62. package/dist/features/workspaces/components/{NewPipelineRunDialog.js → NewWorkflowRunDialog.js} +6 -6
  63. package/dist/features/workspaces/components/{PipelineForm.js → WorkflowRunForm.js} +31 -31
  64. package/dist/features/workspaces/components/WorkspaceHomePage.js +11 -11
  65. package/dist/features/workspaces/components/{pipeline-form → workflow-form}/ArgumentsView.js +1 -1
  66. package/dist/features/workspaces/components/{pipeline-form → workflow-form}/SelectionView.js +16 -16
  67. package/dist/hooks/index.js +3 -3
  68. package/dist/hooks/query-keys.js +31 -72
  69. package/dist/hooks/useConfig.js +5 -5
  70. package/dist/hooks/useProcessor.js +5 -5
  71. package/dist/hooks/useWorkflows.js +155 -68
  72. package/dist/index.d.ts +127 -128
  73. package/dist/index.js +5 -5
  74. package/dist/packages/contracts/dist/enums/index.js +11 -12
  75. package/dist/packages/contracts/dist/enums/workflow-state.enum.js +1 -1
  76. package/dist/pages/DebugWorkflowDetailsPage.js +8 -8
  77. package/dist/pages/DebugWorkflowsPage.js +10 -10
  78. package/dist/pages/EmbedWorkbenchPage.js +42 -52
  79. package/dist/pages/PreviewWorkbenchPage.js +130 -255
  80. package/dist/pages/RunsListPage.js +1 -1
  81. package/dist/pages/StudioLandingPage.js +13 -13
  82. package/dist/pages/WorkbenchPage.js +6 -6
  83. package/dist/pages/WorkflowDebugPage.js +114 -0
  84. package/dist/pages/WorkspacePage.js +4 -2
  85. package/dist/providers/InvalidationEventsProvider.js +19 -19
  86. package/dist/providers/SseProvider.js +0 -1
  87. package/dist/routing/LocalRouter.js +14 -17
  88. package/package.json +2 -2
  89. package/dist/api/namespaces.js +0 -7
  90. package/dist/api/pipelines.js +0 -13
  91. package/dist/components/ai-elements/tool.js +0 -158
  92. package/dist/components/ui-widgets/widgets/SecretInput.js +0 -42
  93. package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +0 -41
  94. package/dist/features/workbench/NavigationItems.js +0 -52
  95. package/dist/features/workbench/WorkbenchNavigation.js +0 -38
  96. package/dist/features/workbench/components/NavigationItem.js +0 -68
  97. package/dist/features/workbench/hooks/useIntersectionObserver.js +0 -44
  98. package/dist/hooks/useNamespaceTree.js +0 -27
  99. package/dist/hooks/useNamespaces.js +0 -25
  100. package/dist/hooks/usePipelines.js +0 -161
  101. package/dist/packages/contracts/dist/enums/pipeline-state.js +0 -10
  102. package/dist/pages/PipelineDebugPage.js +0 -115
  103. /package/dist/features/debug/components/{pipeline-flow → workflow-flow}/StateNode.js +0 -0
  104. /package/dist/features/debug/components/{pipeline-flow → workflow-flow}/WorkflowTransitionEdge.js +0 -0
  105. /package/dist/features/workspaces/components/{pipeline-form → workflow-form}/HeaderSection.js +0 -0
@@ -1,57 +1,48 @@
1
1
  import AiPromptInput_default from "./widgets/AiPromptInput.js";
2
2
  import { ButtonFullWidth } from "./widgets/ButtonFullWidth.js";
3
3
  import { SandboxRun } from "./widgets/SandboxRun.js";
4
- import { SecretInput } from "./widgets/SecretInput.js";
5
4
  import { SubmitButton } from "./widgets/SubmitButton.js";
6
5
  import { c } from "react/compiler-runtime";
7
6
  import React from "react";
8
7
  import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
9
- var UiWidget_default = (l) => {
10
- let u = c(22), { config: d, onSubmit: f, disabled: p, isLoading: m } = l, h = d.options;
11
- switch (d.widget) {
8
+ var UiWidget_default = (s) => {
9
+ let l = c(18), { config: u, onSubmit: d, disabled: f, isLoading: p } = s, m = u.options;
10
+ switch (u.widget) {
12
11
  case "prompt-input": {
13
- let o;
14
- return u[0] !== p || u[1] !== f || u[2] !== h ? (o = /* @__PURE__ */ jsx(AiPromptInput_default, {
15
- disabled: p,
16
- onSubmit: f,
17
- ui: h
18
- }), u[0] = p, u[1] = f, u[2] = h, u[3] = o) : o = u[3], o;
12
+ let a;
13
+ return l[0] !== f || l[1] !== d || l[2] !== m ? (a = /* @__PURE__ */ jsx(AiPromptInput_default, {
14
+ disabled: f,
15
+ onSubmit: d,
16
+ ui: m
17
+ }), l[0] = f, l[1] = d, l[2] = m, l[3] = a) : a = l[3], a;
19
18
  }
20
19
  case "button": {
21
- let e = h, o;
22
- return u[4] !== p || u[5] !== m || u[6] !== f || u[7] !== e ? (o = /* @__PURE__ */ jsx(SubmitButton, {
20
+ let e = m, a;
21
+ return l[4] !== f || l[5] !== p || l[6] !== d || l[7] !== e ? (a = /* @__PURE__ */ jsx(SubmitButton, {
23
22
  ui: e,
24
- disabled: p,
25
- onClick: f,
26
- isLoading: m
27
- }), u[4] = p, u[5] = m, u[6] = f, u[7] = e, u[8] = o) : o = u[8], o;
23
+ disabled: f,
24
+ onClick: d,
25
+ isLoading: p
26
+ }), l[4] = f, l[5] = p, l[6] = d, l[7] = e, l[8] = a) : a = l[8], a;
28
27
  }
29
28
  case "button-full-w": {
30
- let e = h, s;
31
- return u[9] !== p || u[10] !== m || u[11] !== f || u[12] !== e ? (s = /* @__PURE__ */ jsx(ButtonFullWidth, {
29
+ let e = m, o;
30
+ return l[9] !== f || l[10] !== p || l[11] !== d || l[12] !== e ? (o = /* @__PURE__ */ jsx(ButtonFullWidth, {
32
31
  ui: e,
33
- disabled: p,
34
- onClick: f,
35
- isLoading: m
36
- }), u[9] = p, u[10] = m, u[11] = f, u[12] = e, u[13] = s) : s = u[13], s;
32
+ disabled: f,
33
+ onClick: d,
34
+ isLoading: p
35
+ }), l[9] = f, l[10] = p, l[11] = d, l[12] = e, l[13] = o) : o = l[13], o;
37
36
  }
38
37
  case "sandbox-run": {
39
- let e = h, o;
40
- return u[14] !== p || u[15] !== e ? (o = /* @__PURE__ */ jsx(SandboxRun, {
38
+ let e = m, a;
39
+ return l[14] !== f || l[15] !== e ? (a = /* @__PURE__ */ jsx(SandboxRun, {
41
40
  ui: e,
42
- disabled: p
43
- }), u[14] = p, u[15] = e, u[16] = o) : o = u[16], o;
44
- }
45
- case "secret-input": {
46
- let e = h, o;
47
- return u[17] !== p || u[18] !== f || u[19] !== e ? (o = /* @__PURE__ */ jsx(SecretInput, {
48
- ui: e,
49
- disabled: p,
50
- onSubmit: f
51
- }), u[17] = p, u[18] = f, u[19] = e, u[20] = o) : o = u[20], o;
41
+ disabled: f
42
+ }), l[14] = f, l[15] = e, l[16] = a) : a = l[16], a;
52
43
  }
53
44
  }
54
- let g;
55
- return u[21] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx(Fragment$1, {}), u[21] = g) : g = u[21], g;
45
+ let h;
46
+ return l[17] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ jsx(Fragment$1, {}), l[17] = h) : h = l[17], h;
56
47
  };
57
48
  export { UiWidget_default as default };
@@ -4,20 +4,22 @@ import React from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Loader2 } from "lucide-react";
6
6
  const ButtonFullWidth = (a) => {
7
- let o = c(11), { ui: s, disabled: l, onClick: u, isLoading: d } = a, f = s?.label ?? "Submit", p;
7
+ let o = c(13), { ui: s, disabled: l, onClick: u, isLoading: d } = a, f = s?.label ?? "Submit", p;
8
8
  o[0] === s?.props ? p = o[1] : (p = s?.props ?? {}, o[0] = s?.props, o[1] = p);
9
9
  let m = p, h = s?.variant ?? "default", g = l || d, _;
10
- o[2] === d ? _ = o[3] : (_ = d && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), o[2] = d, o[3] = _);
10
+ o[2] === u ? _ = o[3] : (_ = () => u(), o[2] = u, o[3] = _);
11
11
  let v;
12
- return o[4] !== u || o[5] !== m || o[6] !== f || o[7] !== g || o[8] !== _ || o[9] !== h ? (v = /* @__PURE__ */ jsxs(Button, {
12
+ o[4] === d ? v = o[5] : (v = d && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), o[4] = d, o[5] = v);
13
+ let y;
14
+ return o[6] !== m || o[7] !== f || o[8] !== g || o[9] !== _ || o[10] !== v || o[11] !== h ? (y = /* @__PURE__ */ jsxs(Button, {
13
15
  type: "button",
14
16
  variant: h,
15
17
  ...m,
16
18
  disabled: g,
17
- onClick: u,
19
+ onClick: _,
18
20
  size: "lg",
19
21
  className: "w-full font-medium",
20
- children: [_, f]
21
- }), o[4] = u, o[5] = m, o[6] = f, o[7] = g, o[8] = _, o[9] = h, o[10] = v) : v = o[10], v;
22
+ children: [v, f]
23
+ }), o[6] = m, o[7] = f, o[8] = g, o[9] = _, o[10] = v, o[11] = h, o[12] = y) : y = o[12], y;
22
24
  };
23
25
  export { ButtonFullWidth };
@@ -4,20 +4,22 @@ import React from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Loader2 } from "lucide-react";
6
6
  const SubmitButton = (a) => {
7
- let o = c(10), { ui: s, disabled: l, onClick: u, isLoading: d } = a, f = s?.label || "Submit", p;
7
+ let o = c(12), { ui: s, disabled: l, onClick: u, isLoading: d } = a, f = s?.label || "Submit", p;
8
8
  o[0] === s?.props ? p = o[1] : (p = s?.props || {}, o[0] = s?.props, o[1] = p);
9
9
  let m = p, h = l || d, g;
10
- o[2] === d ? g = o[3] : (g = d && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), o[2] = d, o[3] = g);
10
+ o[2] === u ? g = o[3] : (g = () => u(), o[2] = u, o[3] = g);
11
11
  let _;
12
- return o[4] !== u || o[5] !== m || o[6] !== f || o[7] !== h || o[8] !== g ? (_ = /* @__PURE__ */ jsxs(Button, {
12
+ o[4] === d ? _ = o[5] : (_ = d && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), o[4] = d, o[5] = _);
13
+ let v;
14
+ return o[6] !== m || o[7] !== f || o[8] !== h || o[9] !== g || o[10] !== _ ? (v = /* @__PURE__ */ jsxs(Button, {
13
15
  type: "button",
14
16
  variant: "default",
15
17
  ...m,
16
18
  disabled: h,
17
- onClick: u,
19
+ onClick: g,
18
20
  size: "default",
19
21
  className: "w-48",
20
- children: [g, f]
21
- }), o[4] = u, o[5] = m, o[6] = f, o[7] = h, o[8] = g, o[9] = _) : _ = o[9], _;
22
+ children: [_, f]
23
+ }), o[6] = m, o[7] = f, o[8] = h, o[9] = g, o[10] = _, o[11] = v) : v = o[11], v;
22
24
  };
23
25
  export { SubmitButton };
@@ -1,5 +1,5 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
- import { ScrollArea } from "../../../components/ui/scroll-area.js";
2
+ import { ScrollArea, ScrollBar } from "../../../components/ui/scroll-area.js";
3
3
  import MarkdownContent_default from "../../../components/dynamic-form/MarkdownContent.js";
4
4
  import { ReactFlowProvider } from "../../../node_modules/@xyflow/react/dist/esm/index.js";
5
5
  import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../../components/ui/tabs.js";
@@ -29,8 +29,8 @@ var BINARY_EXTENSIONS = new Set([
29
29
  ".dylib"
30
30
  ]);
31
31
  function isBinaryFileName(e) {
32
- let h = e.includes(".") ? e.slice(e.lastIndexOf(".")).toLowerCase() : "";
33
- return BINARY_EXTENSIONS.has(h);
32
+ let g = e.includes(".") ? e.slice(e.lastIndexOf(".")).toLowerCase() : "";
33
+ return BINARY_EXTENSIONS.has(g);
34
34
  }
35
35
  var EXTENSION_LANGUAGE = {
36
36
  ".ts": "typescript",
@@ -67,81 +67,101 @@ var EXTENSION_LANGUAGE = {
67
67
  function getLanguageForFileName(e) {
68
68
  return EXTENSION_LANGUAGE[e.includes(".") ? e.slice(e.lastIndexOf(".")).toLowerCase() : ""] ?? "plaintext";
69
69
  }
70
- function FileContentViewer(v) {
71
- let y = c(39), { selectedFile: b, content: x, workflowConfig: S, isLoading: C, className: w } = v, T = S === void 0 ? null : S, E = C === void 0 ? !1 : C;
72
- if (!b) {
73
- let h;
74
- y[0] === w ? h = y[1] : (h = cn("flex flex-1 items-center justify-center bg-background", w), y[0] = w, y[1] = h);
70
+ function FileContentViewer(y) {
71
+ let b = c(41), { selectedFile: x, content: S, workflowConfig: C, isLoading: w, className: T } = y, E = C === void 0 ? null : C, D = w === void 0 ? !1 : w;
72
+ if (!x) {
75
73
  let g;
76
- y[2] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx("p", {
74
+ b[0] === T ? g = b[1] : (g = cn("flex flex-1 items-center justify-center bg-background", T), b[0] = T, b[1] = g);
75
+ let _;
76
+ b[2] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ jsx("p", {
77
77
  className: "text-sm text-muted-foreground",
78
78
  children: "Select a tab to view its content"
79
- }), y[2] = g) : g = y[2];
80
- let _;
81
- return y[3] === h ? _ = y[4] : (_ = /* @__PURE__ */ jsx("div", {
82
- className: h,
83
- children: g
84
- }), y[3] = h, y[4] = _), _;
79
+ }), b[2] = _) : _ = b[2];
80
+ let v;
81
+ return b[3] === g ? v = b[4] : (v = /* @__PURE__ */ jsx("div", {
82
+ className: g,
83
+ children: _
84
+ }), b[3] = g, b[4] = v), v;
85
85
  }
86
- let D = isBinaryFileName(b.name), O = x != null, k = x ?? "";
87
- if (D && !O) {
88
- let h;
89
- y[5] === w ? h = y[6] : (h = cn("flex flex-1 flex-col rounded-lg border bg-background", w), y[5] = w, y[6] = h);
86
+ let O = isBinaryFileName(x.name), k = S != null, A = S ?? "";
87
+ if (O && !k) {
90
88
  let g;
91
- y[7] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx("div", {
89
+ b[5] === T ? g = b[6] : (g = cn("flex flex-1 flex-col rounded-lg border bg-background", T), b[5] = T, b[6] = g);
90
+ let _;
91
+ b[7] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ jsx("div", {
92
92
  className: "flex flex-1 items-center justify-center p-8",
93
93
  children: /* @__PURE__ */ jsx("p", {
94
94
  className: "text-sm text-muted-foreground",
95
95
  children: "Binary file — preview not available"
96
96
  })
97
- }), y[7] = g) : g = y[7];
98
- let _;
99
- return y[8] === h ? _ = y[9] : (_ = /* @__PURE__ */ jsx("div", {
100
- className: h,
101
- children: g
102
- }), y[8] = h, y[9] = _), _;
97
+ }), b[7] = _) : _ = b[7];
98
+ let v;
99
+ return b[8] === g ? v = b[9] : (v = /* @__PURE__ */ jsx("div", {
100
+ className: g,
101
+ children: _
102
+ }), b[8] = g, b[9] = v), v;
103
103
  }
104
- if (!O && !E) {
105
- let h;
106
- y[10] === w ? h = y[11] : (h = cn("flex flex-1 flex-col rounded-lg border bg-background", w), y[10] = w, y[11] = h);
104
+ if (!k && !D) {
107
105
  let g;
108
- y[12] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx("div", {
106
+ b[10] === T ? g = b[11] : (g = cn("flex flex-1 flex-col rounded-lg border bg-background", T), b[10] = T, b[11] = g);
107
+ let _;
108
+ b[12] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ jsx("div", {
109
109
  className: "flex flex-1 items-center justify-center p-8",
110
110
  children: /* @__PURE__ */ jsx("p", {
111
111
  className: "text-sm text-destructive",
112
112
  children: "Error loading file content"
113
113
  })
114
- }), y[12] = g) : g = y[12];
115
- let _;
116
- return y[13] === h ? _ = y[14] : (_ = /* @__PURE__ */ jsx("div", {
117
- className: h,
118
- children: g
119
- }), y[13] = h, y[14] = _), _;
114
+ }), b[12] = _) : _ = b[12];
115
+ let v;
116
+ return b[13] === g ? v = b[14] : (v = /* @__PURE__ */ jsx("div", {
117
+ className: g,
118
+ children: _
119
+ }), b[13] = g, b[14] = v), v;
120
120
  }
121
- if (E) {
122
- let h;
123
- y[15] === w ? h = y[16] : (h = cn("flex flex-1 flex-col rounded-lg border bg-background", w), y[15] = w, y[16] = h);
121
+ if (D) {
124
122
  let g;
125
- y[17] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx("div", {
123
+ b[15] === T ? g = b[16] : (g = cn("flex flex-1 flex-col rounded-lg border bg-background", T), b[15] = T, b[16] = g);
124
+ let _;
125
+ b[17] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ jsx("div", {
126
126
  className: "flex justify-center p-8",
127
127
  children: /* @__PURE__ */ jsx(Loader2, { className: "h-6 w-6 animate-spin text-muted-foreground" })
128
- }), y[17] = g) : g = y[17];
129
- let _;
130
- return y[18] === h ? _ = y[19] : (_ = /* @__PURE__ */ jsx("div", {
131
- className: h,
132
- children: g
133
- }), y[18] = h, y[19] = _), _;
128
+ }), b[17] = _) : _ = b[17];
129
+ let v;
130
+ return b[18] === g ? v = b[19] : (v = /* @__PURE__ */ jsx("div", {
131
+ className: g,
132
+ children: _
133
+ }), b[18] = g, b[19] = v), v;
134
134
  }
135
- let A;
136
- y[20] === b.name ? A = y[21] : (A = getLanguageForFileName(b.name), y[20] = b.name, y[21] = A);
137
- let j = A, M;
138
- y[22] !== j || y[23] !== b.name ? (M = j === "markdown" || b.name.endsWith(".md") || b.name.endsWith(".mdx"), y[22] = j, y[23] = b.name, y[24] = M) : M = y[24];
139
- let N = M, P;
140
- y[25] !== j || y[26] !== b.name ? (P = j === "yaml" || b.name.endsWith(".yaml") || b.name.endsWith(".yml"), y[25] = j, y[26] = b.name, y[27] = P) : P = y[27];
141
- let F = P && T !== null, I;
142
- y[28] === w ? I = y[29] : (I = cn("flex h-full flex-col overflow-hidden rounded-lg border bg-background", w), y[28] = w, y[29] = I);
143
- let L;
144
- y[30] !== k || y[31] !== N || y[32] !== F || y[33] !== j || y[34] !== T ? (L = N && k ? /* @__PURE__ */ jsxs(Tabs, {
135
+ let j;
136
+ b[20] === x.name ? j = b[21] : (j = getLanguageForFileName(x.name), b[20] = x.name, b[21] = j);
137
+ let M = j, N;
138
+ b[22] !== M || b[23] !== x.name ? (N = M === "markdown" || x.name.endsWith(".md") || x.name.endsWith(".mdx"), b[22] = M, b[23] = x.name, b[24] = N) : N = b[24];
139
+ let P = N, F;
140
+ b[25] !== M || b[26] !== x.name ? (F = M === "yaml" || x.name.endsWith(".yaml") || x.name.endsWith(".yml"), b[25] = M, b[26] = x.name, b[27] = F) : F = b[27];
141
+ let I = F && E !== null, L;
142
+ b[28] === M ? L = b[29] : (L = (e) => /* @__PURE__ */ jsxs(ScrollArea, {
143
+ className: "h-full w-full",
144
+ children: [/* @__PURE__ */ jsx(Prism, {
145
+ language: M,
146
+ style: vscDarkPlus,
147
+ customStyle: {
148
+ margin: 0,
149
+ padding: "1rem",
150
+ fontSize: "13px",
151
+ overflow: "visible",
152
+ minWidth: "max-content",
153
+ width: "100%"
154
+ },
155
+ showLineNumbers: !0,
156
+ PreTag: "div",
157
+ codeTagProps: { style: { fontFamily: "inherit" } },
158
+ children: e
159
+ }), /* @__PURE__ */ jsx(ScrollBar, { orientation: "horizontal" })]
160
+ }), b[28] = M, b[29] = L);
161
+ let R = L, z;
162
+ b[30] === T ? z = b[31] : (z = cn("flex h-full flex-col overflow-hidden rounded-lg border bg-background", T), b[30] = T, b[31] = z);
163
+ let B;
164
+ b[32] !== A || b[33] !== P || b[34] !== I || b[35] !== R || b[36] !== E ? (B = P && A ? /* @__PURE__ */ jsxs(Tabs, {
145
165
  defaultValue: "rendered",
146
166
  className: "flex h-full flex-col overflow-hidden",
147
167
  children: [
@@ -162,32 +182,17 @@ function FileContentViewer(v) {
162
182
  className: "h-full",
163
183
  children: /* @__PURE__ */ jsx("div", {
164
184
  className: "p-4",
165
- children: /* @__PURE__ */ jsx(MarkdownContent_default, { content: k })
185
+ children: /* @__PURE__ */ jsx(MarkdownContent_default, { content: A })
166
186
  })
167
187
  })
168
188
  }),
169
189
  /* @__PURE__ */ jsx(TabsContent, {
170
190
  value: "unrendered",
171
191
  className: "flex-1 min-h-0 overflow-hidden mt-0",
172
- children: /* @__PURE__ */ jsx(ScrollArea, {
173
- className: "flex-1 min-h-0",
174
- children: /* @__PURE__ */ jsx(Prism, {
175
- language: j,
176
- style: vscDarkPlus,
177
- customStyle: {
178
- margin: 0,
179
- padding: "1rem",
180
- fontSize: "13px"
181
- },
182
- showLineNumbers: !0,
183
- PreTag: "div",
184
- codeTagProps: { style: { fontFamily: "inherit" } },
185
- children: k ?? ""
186
- })
187
- })
192
+ children: R(A)
188
193
  })
189
194
  ]
190
- }) : F && T ? /* @__PURE__ */ jsxs(Tabs, {
195
+ }) : I && E ? /* @__PURE__ */ jsxs(Tabs, {
191
196
  defaultValue: "code",
192
197
  className: "flex h-full flex-col overflow-hidden",
193
198
  children: [
@@ -204,52 +209,22 @@ function FileContentViewer(v) {
204
209
  /* @__PURE__ */ jsx(TabsContent, {
205
210
  value: "code",
206
211
  className: "flex-1 min-h-0 overflow-hidden mt-0",
207
- children: /* @__PURE__ */ jsx(ScrollArea, {
208
- className: "flex-1 min-h-0",
209
- children: /* @__PURE__ */ jsx(Prism, {
210
- language: j,
211
- style: vscDarkPlus,
212
- customStyle: {
213
- margin: 0,
214
- padding: "1rem",
215
- fontSize: "13px"
216
- },
217
- showLineNumbers: !0,
218
- PreTag: "div",
219
- codeTagProps: { style: { fontFamily: "inherit" } },
220
- children: k ?? ""
221
- })
222
- })
212
+ children: R(A)
223
213
  }),
224
214
  /* @__PURE__ */ jsx(TabsContent, {
225
215
  value: "flow",
226
216
  className: "flex-1 min-h-0 overflow-hidden mt-0",
227
217
  children: /* @__PURE__ */ jsx("div", {
228
218
  className: "h-full w-full",
229
- children: /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(ConfigFlowViewer_default, { config: T }) })
219
+ children: /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(ConfigFlowViewer_default, { config: E }) })
230
220
  })
231
221
  })
232
222
  ]
233
- }) : /* @__PURE__ */ jsx(ScrollArea, {
234
- className: "flex-1 min-h-0",
235
- children: /* @__PURE__ */ jsx(Prism, {
236
- language: j,
237
- style: vscDarkPlus,
238
- customStyle: {
239
- margin: 0,
240
- padding: "1rem",
241
- fontSize: "13px"
242
- },
243
- showLineNumbers: !0,
244
- PreTag: "div",
245
- codeTagProps: { style: { fontFamily: "inherit" } },
246
- children: k ?? ""
247
- })
248
- }), y[30] = k, y[31] = N, y[32] = F, y[33] = j, y[34] = T, y[35] = L) : L = y[35];
249
- let R;
250
- return y[36] !== I || y[37] !== L ? (R = /* @__PURE__ */ jsx("div", {
251
- className: I,
252
- children: L
253
- }), y[36] = I, y[37] = L, y[38] = R) : R = y[38], R;
223
+ }) : R(A), b[32] = A, b[33] = P, b[34] = I, b[35] = R, b[36] = E, b[37] = B) : B = b[37];
224
+ let V;
225
+ return b[38] !== z || b[39] !== B ? (V = /* @__PURE__ */ jsx("div", {
226
+ className: z,
227
+ children: B
228
+ }), b[38] = z, b[39] = B, b[40] = V) : V = b[40], V;
254
229
  }
255
230
  export { FileContentViewer };
@@ -11,7 +11,7 @@ function RunItem(a) {
11
11
  paused: "bg-yellow-50 text-yellow-900 border-yellow-200",
12
12
  pending: "bg-muted text-muted-foreground border-border"
13
13
  }[s.status] || "bg-muted text-muted-foreground border-border", d;
14
- o[0] !== l || o[1] !== s.id ? (d = l.getPipeline(s.id), o[0] = l, o[1] = s.id, o[2] = d) : d = o[2];
14
+ o[0] !== l || o[1] !== s.id ? (d = l.getWorkflow(s.id), o[0] = l, o[1] = s.id, o[2] = d) : d = o[2];
15
15
  let f = s.id, p = s.run ?? s.index ?? "?", m = s.title ? `(${s.title})` : "", h;
16
16
  o[3] !== p || o[4] !== m ? (h = /* @__PURE__ */ jsxs("h3", {
17
17
  className: "text-foreground group-hover:text-primary truncate font-semibold transition-colors",
@@ -1,8 +1,8 @@
1
1
  import { Background, BackgroundVariant, Controls, index, useEdgesState, useNodesState, useReactFlow } from "../../../node_modules/@xyflow/react/dist/esm/index.js";
2
2
  /* empty css */
3
- import StateNode_default from "./pipeline-flow/StateNode.js";
3
+ import StateNode_default from "./workflow-flow/StateNode.js";
4
4
  import { buildWorkflowGraph } from "../lib/flow-utils.js";
5
- import WorkflowTransitionEdge_default from "./pipeline-flow/WorkflowTransitionEdge.js";
5
+ import WorkflowTransitionEdge_default from "./workflow-flow/WorkflowTransitionEdge.js";
6
6
  import { c } from "react/compiler-runtime";
7
7
  import React, { useEffect, useRef } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,9 +1,9 @@
1
1
  import { Button } from "../../../components/ui/button.js";
2
- import PipelineDebugLegend_default from "./PipelineDebugLegend.js";
2
+ import WorkflowDebugLegend_default from "./WorkflowDebugLegend.js";
3
3
  import { c } from "react/compiler-runtime";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { ArrowLeft } from "lucide-react";
6
- var PipelineDebugHeader_default = (o) => {
6
+ var WorkflowDebugHeader_default = (o) => {
7
7
  let s = c(16), { title: l, runNumber: u, onBack: d } = o, f;
8
8
  s[0] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ jsx(ArrowLeft, { className: "h-4 w-4" }), s[0] = f) : f = s[0];
9
9
  let p;
@@ -22,7 +22,7 @@ var PipelineDebugHeader_default = (o) => {
22
22
  let h = u && `· Run #${u}`, g;
23
23
  s[5] === h ? g = s[6] : (g = /* @__PURE__ */ jsxs("p", {
24
24
  className: "text-muted-foreground text-xs font-medium tracking-wider uppercase",
25
- children: ["Pipeline Flow Visualization ", h]
25
+ children: ["Workflow Flow Visualization ", h]
26
26
  }), s[5] = h, s[6] = g);
27
27
  let _;
28
28
  s[7] !== m || s[8] !== g ? (_ = /* @__PURE__ */ jsxs("div", {
@@ -37,7 +37,7 @@ var PipelineDebugHeader_default = (o) => {
37
37
  let y;
38
38
  s[13] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ jsx("div", {
39
39
  className: "hidden items-center gap-6 sm:flex",
40
- children: /* @__PURE__ */ jsx(PipelineDebugLegend_default, {})
40
+ children: /* @__PURE__ */ jsx(WorkflowDebugLegend_default, {})
41
41
  }), s[13] = y) : y = s[13];
42
42
  let b;
43
43
  return s[14] === v ? b = s[15] : (b = /* @__PURE__ */ jsxs("div", {
@@ -45,4 +45,4 @@ var PipelineDebugHeader_default = (o) => {
45
45
  children: [v, y]
46
46
  }), s[14] = v, s[15] = b), b;
47
47
  };
48
- export { PipelineDebugHeader_default as default };
48
+ export { WorkflowDebugHeader_default as default };
@@ -1,7 +1,7 @@
1
1
  import { c } from "react/compiler-runtime";
2
2
  import React from "react";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
- var PipelineDebugLegend_default = () => {
4
+ var WorkflowDebugLegend_default = () => {
5
5
  let r = c(7), i;
6
6
  r[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ jsxs("div", {
7
7
  className: "flex items-center gap-2",
@@ -65,4 +65,4 @@ var PipelineDebugLegend_default = () => {
65
65
  ]
66
66
  }), r[6] = d) : d = r[6], d;
67
67
  };
68
- export { PipelineDebugLegend_default as default };
68
+ export { WorkflowDebugLegend_default as default };
@@ -1,15 +1,15 @@
1
- import { usePipeline } from "../../../hooks/usePipelines.js";
1
+ import { useWorkflow } from "../../../hooks/useWorkflows.js";
2
2
  import { Background, BackgroundVariant, Controls, index, useEdgesState, useNodesState, useReactFlow } from "../../../node_modules/@xyflow/react/dist/esm/index.js";
3
3
  /* empty css */
4
- import StateNode_default from "./pipeline-flow/StateNode.js";
5
- import WorkflowGraph_default from "./pipeline-flow/WorkflowGraph.js";
6
- import WorkflowTransitionEdge_default from "./pipeline-flow/WorkflowTransitionEdge.js";
4
+ import StateNode_default from "./workflow-flow/StateNode.js";
5
+ import WorkflowGraph_default from "./workflow-flow/WorkflowGraph.js";
6
+ import WorkflowTransitionEdge_default from "./workflow-flow/WorkflowTransitionEdge.js";
7
7
  import { c } from "react/compiler-runtime";
8
8
  import React, { useCallback, useEffect, useRef, useState } from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { Loader2 } from "lucide-react";
11
- var nodeTypes = { stateNode: StateNode_default }, edgeTypes = { workflowTransition: WorkflowTransitionEdge_default }, PipelineFlowViewer_default = (b) => {
12
- let x = c(29), { pipelineId: S, workflows: C, pipelineConfig: w, direction: T } = b, E = T === void 0 ? "LR" : T, { data: D } = usePipeline(S), O;
11
+ var nodeTypes = { stateNode: StateNode_default }, edgeTypes = { workflowTransition: WorkflowTransitionEdge_default }, WorkflowFlowViewer_default = (b) => {
12
+ let x = c(29), { workflowId: S, workflows: C, workflowConfig: w, direction: T } = b, E = T === void 0 ? "LR" : T, { data: D } = useWorkflow(S), O;
13
13
  x[0] === Symbol.for("react.memo_cache_sentinel") ? (O = [], x[0] = O) : O = x[0];
14
14
  let [k, A, j] = useNodesState(O), M;
15
15
  x[1] === Symbol.for("react.memo_cache_sentinel") ? (M = [], x[1] = M) : M = x[1];
@@ -65,9 +65,9 @@ var nodeTypes = { stateNode: StateNode_default }, edgeTypes = { workflowTransiti
65
65
  }
66
66
  let X;
67
67
  x[15] !== E || x[16] !== q || x[17] !== D || x[18] !== w || x[19] !== C ? (X = D && C.map((e) => /* @__PURE__ */ jsx(WorkflowGraph_default, {
68
- pipeline: D,
68
+ parentWorkflow: D,
69
69
  workflow: e,
70
- pipelineConfig: w,
70
+ workflowConfig: w,
71
71
  onGraphReady: q,
72
72
  onLoadingChange: G,
73
73
  direction: E
@@ -107,4 +107,4 @@ var nodeTypes = { stateNode: StateNode_default }, edgeTypes = { workflowTransiti
107
107
  function _temp(e) {
108
108
  return e;
109
109
  }
110
- export { PipelineFlowViewer_default as default };
110
+ export { WorkflowFlowViewer_default as default };
@@ -0,0 +1,46 @@
1
+ import { useWorkflow, useWorkflowCheckpoints } from "../../../../hooks/useWorkflows.js";
2
+ import { buildWorkflowGraph, getTransitions } from "../../lib/flow-utils.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import React, { useEffect, useRef } from "react";
5
+ function countTransitions(e) {
6
+ return e ? getTransitions(e).length : 0;
7
+ }
8
+ var WorkflowGraph_default = (l) => {
9
+ let u = c(24), { parentWorkflow: d, workflow: f, workflowConfig: p, onGraphReady: m, onLoadingChange: h, direction: g } = l, _ = g === void 0 ? "LR" : g, v = useWorkflow(f.id), y = v.data, b = useWorkflowCheckpoints(f.id), x;
10
+ u[0] === b.data ? x = u[1] : (x = b.data ?? [], u[0] = b.data, u[1] = x);
11
+ let S = x, C = useRef(null), w = v.isLoading || b.isLoading, T, E;
12
+ u[2] !== w || u[3] !== h || u[4] !== f.id ? (T = () => {
13
+ h(f.id, w);
14
+ }, E = [
15
+ f.id,
16
+ w,
17
+ h
18
+ ], u[2] = w, u[3] = h, u[4] = f.id, u[5] = T, u[6] = E) : (T = u[5], E = u[6]), useEffect(T, E);
19
+ let D;
20
+ u[7] !== S || u[8] !== _ || u[9] !== w || u[10] !== m || u[11] !== d || u[12] !== f.id || u[13] !== p || u[14] !== y ? (D = () => {
21
+ if (w) return;
22
+ let e = p ? getTransitions(p) : [], a = JSON.stringify({
23
+ p: countTransitions(d),
24
+ w: countTransitions(y),
25
+ c: e.length,
26
+ checkpoints: S.length,
27
+ place: y?.place
28
+ });
29
+ if (a !== C.current) {
30
+ C.current = a;
31
+ let { nodes: o, edges: s } = buildWorkflowGraph(d, y, f.id, e, _, !1, S);
32
+ m(f.id, o, s);
33
+ }
34
+ }, u[7] = S, u[8] = _, u[9] = w, u[10] = m, u[11] = d, u[12] = f.id, u[13] = p, u[14] = y, u[15] = D) : D = u[15];
35
+ let O;
36
+ return u[16] !== S || u[17] !== w || u[18] !== m || u[19] !== d || u[20] !== f || u[21] !== p || u[22] !== y ? (O = [
37
+ d,
38
+ f,
39
+ y,
40
+ S,
41
+ p,
42
+ m,
43
+ w
44
+ ], u[16] = S, u[17] = w, u[18] = m, u[19] = d, u[20] = f, u[21] = p, u[22] = y, u[23] = O) : O = u[23], useEffect(D, O), null;
45
+ };
46
+ export { WorkflowGraph_default as default };
@@ -1,3 +1,3 @@
1
- import PipelineFlowViewer_default from "./components/PipelineFlowViewer.js";
2
- import PipelineDebugHeader_default from "./components/PipelineDebugHeader.js";
1
+ import WorkflowFlowViewer_default from "./components/WorkflowFlowViewer.js";
2
+ import WorkflowDebugHeader_default from "./components/WorkflowDebugHeader.js";
3
3
  import ConfigFlowViewer_default from "./components/ConfigFlowViewer.js";