@loopstack/loopstack-studio 0.29.5 → 0.31.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 (122) hide show
  1. package/dist/_virtual/rolldown_runtime.js +3 -1
  2. package/dist/api/config.js +5 -4
  3. package/dist/api/environments.js +5 -1
  4. package/dist/api/processor.js +4 -1
  5. package/dist/app/EnvironmentEmbedRoot.js +22 -30
  6. package/dist/components/ai-elements/code-block.js +4 -4
  7. package/dist/components/dynamic-form/CodeContent.js +1 -1
  8. package/dist/components/dynamic-form/FormBody.js +1 -1
  9. package/dist/components/layout/StudioSidebar.js +116 -131
  10. package/dist/components/lists/ListView.js +46 -46
  11. package/dist/components/motion/FadeIn.js +72 -0
  12. package/dist/components/motion/StreamingText.js +49 -0
  13. package/dist/components/ui/accordion.js +2 -2
  14. package/dist/components/ui-widgets/UiWidget.js +11 -10
  15. package/dist/components/ui-widgets/widgets/AiPromptInput.js +31 -28
  16. package/dist/events/sse-client-events.js +7 -1
  17. package/dist/features/code-explorer/components/FileContentViewer.js +2 -2
  18. package/dist/features/dashboard/AppLauncher.js +84 -0
  19. package/dist/features/debug/components/WorkflowFlowViewer.js +49 -51
  20. package/dist/features/documents/DocumentRenderer.js +18 -17
  21. package/dist/features/documents/components/DocumentItem.js +42 -20
  22. package/dist/features/documents/components/DocumentList.js +34 -36
  23. package/dist/features/documents/components/DocumentMetadataPills.js +102 -49
  24. package/dist/features/documents/document-details/DocumentDetails.js +577 -377
  25. package/dist/features/documents/document-details/PromptDetails.js +118 -130
  26. package/dist/features/documents/document-details/document-debug-utils.js +100 -0
  27. package/dist/features/documents/renderers/ChoicesRenderer.js +41 -38
  28. package/dist/features/documents/renderers/ConfirmPromptRenderer.js +31 -28
  29. package/dist/features/documents/renderers/DocumentFormRenderer.js +62 -70
  30. package/dist/features/documents/renderers/LlmMessage.js +52 -47
  31. package/dist/features/documents/renderers/TextPromptRenderer.js +32 -29
  32. package/dist/features/documents/renderers/useDocumentTransition.js +4 -4
  33. package/dist/features/feature-registry/FeatureRegistryProvider.js +32 -10
  34. package/dist/features/feature-registry/available-features.js +12 -0
  35. package/dist/features/feature-registry/index.js +2 -1
  36. package/dist/features/file-explorer/components/FileExplorerPanel.js +55 -51
  37. package/dist/features/git/components/GitBranchBadge.js +31 -0
  38. package/dist/features/git/components/GitCommitList.js +46 -0
  39. package/dist/features/git/components/GitRemoteStatus.js +84 -0
  40. package/dist/features/git/components/WorkbenchGitPanel.js +81 -0
  41. package/dist/features/git/git-feature.js +12 -0
  42. package/dist/features/git/hooks/useGit.js +78 -0
  43. package/dist/features/git/index.js +1 -0
  44. package/dist/features/oauth/OAuthPromptRenderer.js +137 -142
  45. package/dist/features/runs/Runs.js +73 -73
  46. package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
  47. package/dist/features/secrets/renderers/SecretInputRenderer.js +30 -29
  48. package/dist/features/workbench/Workbench.js +25 -33
  49. package/dist/features/workbench/WorkflowItem.js +9 -9
  50. package/dist/features/workbench/WorkflowList.js +61 -62
  51. package/dist/features/workbench/components/NewRunDialog.js +237 -209
  52. package/dist/features/workbench/components/RecentRunItem.js +3 -3
  53. package/dist/features/workbench/components/WorkbenchEnvironmentPanel.js +8 -8
  54. package/dist/features/workbench/components/WorkbenchIconSidebar.js +74 -109
  55. package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
  56. package/dist/features/workbench/components/WorkflowForms.js +11 -10
  57. package/dist/features/workbench/components/WorkflowHistoryItem.js +16 -36
  58. package/dist/features/workbench/components/WorkflowHistoryList.js +19 -17
  59. package/dist/features/workbench/components/buttons/WorkflowButtons.js +3 -3
  60. package/dist/features/workbench/hooks/useLlmStreamingDocuments.js +159 -0
  61. package/dist/features/workbench/hooks/useWorkflowData.js +58 -31
  62. package/dist/features/workbench/index.js +2 -2
  63. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +53 -53
  64. package/dist/features/workspaces/Workspaces.js +166 -136
  65. package/dist/features/workspaces/components/CreateWorkspace.js +115 -107
  66. package/dist/features/workspaces/components/ExecutionTimeline.js +2 -2
  67. package/dist/features/workspaces/components/WorkflowRunForm.js +127 -104
  68. package/dist/features/workspaces/components/WorkspaceHomePage.js +6 -89
  69. package/dist/features/workspaces/components/workflow-form/ArgumentsView.js +1 -1
  70. package/dist/features/workspaces/components/workflow-form/SelectionView.js +15 -15
  71. package/dist/hooks/index.js +3 -2
  72. package/dist/hooks/query-keys.js +43 -30
  73. package/dist/hooks/useConfig.js +28 -22
  74. package/dist/hooks/useEnvironments.js +27 -2
  75. package/dist/hooks/useProcessor.js +14 -1
  76. package/dist/hooks/useWorkflows.js +4 -4
  77. package/dist/index.d.ts +119 -18
  78. package/dist/index.js +10 -9
  79. package/dist/node_modules/d3/src/index.js +13 -13
  80. package/dist/node_modules/d3-scale/src/continuous.js +16 -16
  81. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-3BPJPVTR.js +43 -43
  82. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-GPEHLZMM.js +270 -270
  83. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAUBKEIU.js +90 -90
  84. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-3OPIFGDE.js +458 -458
  85. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-55IACEB6.js +3 -3
  86. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5ZQYHXKU.js +37 -37
  87. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-727SXJPM.js +208 -208
  88. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-KSCS5N6A.js +145 -145
  89. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ND2GUHAM.js +7 -7
  90. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-O5CBEL6O.js +41 -41
  91. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-WU5MYG2G.js +3 -3
  92. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/cose-bilkent-S5V4N54A.js +6 -6
  93. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-KO2AKTUF.js +30 -30
  94. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-OG6HWLK6.js +82 -82
  95. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-TEJ5UH35.js +65 -65
  96. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-I6XJVG4X.js +227 -227
  97. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-6RSMTGT7.js +104 -104
  98. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-PVQCEYII.js +104 -104
  99. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-JHISSGLW.js +49 -49
  100. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-W4KKPZXB.js +101 -101
  101. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-5OEKKPKP.js +20 -20
  102. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-3UESZ5HK.js +354 -354
  103. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-AJRCARHV.js +53 -53
  104. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-PNZ67QCA.js +113 -113
  105. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-CIIHVFJN.js +90 -90
  106. package/dist/node_modules/mermaid/dist/mermaid.core.js +156 -156
  107. package/dist/node_modules/motion/dist/es/react.js +9 -2
  108. package/dist/pages/DashboardPage.js +20 -74
  109. package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
  110. package/dist/pages/DebugWorkflowsPage.js +76 -106
  111. package/dist/pages/EmbedWorkbenchPage.js +1 -1
  112. package/dist/pages/PreviewWorkbenchPage.js +6 -6
  113. package/dist/pages/WorkbenchPage.js +43 -47
  114. package/dist/pages/WorkflowDebugPage.js +6 -12
  115. package/dist/pages/WorkspacePage.js +40 -66
  116. package/dist/pages/WorkspaceRunsPage.js +24 -31
  117. package/dist/routing/LocalRouter.js +1 -1
  118. package/package.json +2 -2
  119. package/dist/features/dashboard/Dashboard.js +0 -125
  120. package/dist/features/dashboard/RunItem.js +0 -78
  121. package/dist/features/dashboard/RunList.js +0 -32
  122. package/dist/hooks/useDashboard.js +0 -16
@@ -11,8 +11,10 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
11
11
  enumerable: !(s = __getOwnPropDesc(i, d)) || s.enumerable
12
12
  });
13
13
  return e;
14
+ }, __reExport = (e, n, r, i) => {
15
+ i && (__defProp(e, Symbol.toStringTag, { value: "Module" }), r && __defProp(r, Symbol.toStringTag, { value: "Module" })), __copyProps(e, n, "default"), r && __copyProps(r, n, "default");
14
16
  }, __toESM = (n, r, a) => (a = n == null ? {} : __create(__getProtoOf(n)), __copyProps(r || !n || !n.__esModule ? __defProp(a, "default", {
15
17
  value: n,
16
18
  enumerable: !0
17
19
  }) : a, n));
18
- export { __commonJSMin, __export, __toESM };
20
+ export { __commonJSMin, __export, __reExport, __toESM };
@@ -1,9 +1,10 @@
1
1
  function createConfigApi(e) {
2
2
  return {
3
- getAppTypes: () => e.get("/api/v1/config/workspaces").then((e) => e.data),
4
- getWorkflowTypesByApp: (t) => e.get(`/api/v1/config/workspaces/${encodeURIComponent(t.appBlockName)}/workflows`).then((e) => e.data),
5
- getWorkflowConfig: (t) => e.get(`/api/v1/config/workflows/${encodeURIComponent(t.alias)}`).then((e) => e.data),
6
- getWorkflowSource: (t) => e.get(`/api/v1/config/workflows/${encodeURIComponent(t.alias)}/source`).then((e) => e.data),
3
+ getApps: () => e.get("/api/v1/config/apps").then((e) => e.data),
4
+ getWorkflowConfig: (t) => e.get(`/api/v1/config/workflows/${encodeURIComponent(t.workflowName)}`).then((e) => e.data),
5
+ getWorkflowSource: (t) => e.get(`/api/v1/config/workflows/${encodeURIComponent(t.workflowName)}/source`).then((e) => e.data),
6
+ getToolConfigs: () => e.get("/api/v1/config/tools").then((e) => e.data),
7
+ getToolConfig: (t) => e.get(`/api/v1/config/tools/${encodeURIComponent(t.toolName)}`).then((e) => e.data),
7
8
  getAvailableEnvironments: () => e.get("/api/v1/config/environments").then((e) => e.data)
8
9
  };
9
10
  }
@@ -1,4 +1,8 @@
1
1
  function createEnvironmentsApi(e) {
2
- return { resetEnvironment: (t) => e.post(`/api/v1/workspaces/${t.workspaceId}/environments/${t.slotId}/reset`).then((e) => e.data) };
2
+ return {
3
+ getByWorkspace: (t) => e.get(`/api/v1/workspaces/${t}/environments`).then((e) => e.data),
4
+ replaceEnvironments: (t, n) => e.put(`/api/v1/workspaces/${t}/environments`, n).then((e) => e.data),
5
+ resetEnvironment: (t) => e.post(`/api/v1/workspaces/${t.workspaceId}/environments/${t.slotId}/reset`).then((e) => e.data)
6
+ };
3
7
  }
4
8
  export { createEnvironmentsApi };
@@ -1,4 +1,7 @@
1
1
  function createProcessorApi(e) {
2
- return { runWorkflow: (t) => e.post(`/api/v1/processor/run/${t.workflowId}`, t.runWorkflowPayloadDto, t.force === void 0 ? void 0 : { params: { force: t.force } }).then((e) => e.data) };
2
+ return {
3
+ startWorkflow: (t) => e.post("/api/v1/processor/start", t.payload).then((e) => e.data),
4
+ runWorkflow: (t) => e.post(`/api/v1/processor/run/${t.workflowId}`, t.runWorkflowPayloadDto, t.force === void 0 ? void 0 : { params: { force: t.force } }).then((e) => e.data)
5
+ };
3
6
  }
4
7
  export { createProcessorApi };
@@ -4,42 +4,34 @@ import { InvalidationEventsProvider } from "../providers/InvalidationEventsProvi
4
4
  import { useRouter } from "../routing/LocalRouter.js";
5
5
  import { FeatureRegistryProvider } from "../features/feature-registry/FeatureRegistryProvider.js";
6
6
  import "../features/feature-registry/index.js";
7
- import { fileExplorerFeature } from "../features/file-explorer/file-explorer-feature.js";
8
- import "../features/file-explorer/index.js";
9
7
  import LocalHealthCheck_default from "../features/health/LocalHealthCheck.js";
10
- import { secretsFeature } from "../features/secrets/secrets-feature.js";
11
- import "../features/secrets/index.js";
12
8
  import { QueryProvider } from "../providers/QueryProvider.js";
13
9
  import { c } from "react/compiler-runtime";
14
10
  import { jsx, jsxs } from "react/jsx-runtime";
15
11
  import { Outlet, useSearchParams } from "react-router-dom";
16
- var defaultFeatures = [secretsFeature, fileExplorerFeature];
17
12
  function EnvironmentEmbedRoot() {
18
- let m = c(11), [h] = useSearchParams(), g;
19
- m[0] === h ? g = m[1] : (g = h.get("url") ?? "http://localhost:3080", m[0] = h, m[1] = g);
20
- let _ = g, v;
21
- m[2] === h ? v = m[3] : (v = h.get("name") ?? "Preview Environment", m[2] = h, m[3] = v);
22
- let y = v, b;
23
- m[4] !== y || m[5] !== _ ? (b = {
13
+ let p = c(11), [m] = useSearchParams(), h;
14
+ p[0] === m ? h = p[1] : (h = m.get("url") ?? "http://localhost:3080", p[0] = m, p[1] = h);
15
+ let g = h, _;
16
+ p[2] === m ? _ = p[3] : (_ = m.get("name") ?? "Preview Environment", p[2] = m, p[3] = _);
17
+ let v = _, y;
18
+ p[4] !== v || p[5] !== g ? (y = {
24
19
  id: "preview-env",
25
- name: y,
26
- url: _
27
- }, m[4] = y, m[5] = _, m[6] = b) : b = m[6];
28
- let x = b, S = useRouter(x.id, "/embed/env"), C;
29
- m[7] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsxs(FeatureRegistryProvider, {
30
- features: defaultFeatures,
31
- children: [
32
- /* @__PURE__ */ jsx(LocalHealthCheck_default, {}),
33
- /* @__PURE__ */ jsx(SseProvider, {}),
34
- /* @__PURE__ */ jsx(InvalidationEventsProvider, {}),
35
- /* @__PURE__ */ jsx(Outlet, {})
36
- ]
37
- }), m[7] = C) : C = m[7];
38
- let w;
39
- return m[8] !== x || m[9] !== S ? (w = /* @__PURE__ */ jsx(QueryProvider, { children: /* @__PURE__ */ jsx(StudioProvider, {
40
- router: S,
41
- environment: x,
42
- children: C
43
- }) }), m[8] = x, m[9] = S, m[10] = w) : w = m[10], w;
20
+ name: v,
21
+ url: g
22
+ }, p[4] = v, p[5] = g, p[6] = y) : y = p[6];
23
+ let b = y, x = useRouter(b.id, "/embed/env"), S;
24
+ p[7] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ jsxs(FeatureRegistryProvider, { children: [
25
+ /* @__PURE__ */ jsx(LocalHealthCheck_default, {}),
26
+ /* @__PURE__ */ jsx(SseProvider, {}),
27
+ /* @__PURE__ */ jsx(InvalidationEventsProvider, {}),
28
+ /* @__PURE__ */ jsx(Outlet, {})
29
+ ] }), p[7] = S) : S = p[7];
30
+ let C;
31
+ return p[8] !== b || p[9] !== x ? (C = /* @__PURE__ */ jsx(QueryProvider, { children: /* @__PURE__ */ jsx(StudioProvider, {
32
+ router: x,
33
+ environment: b,
34
+ children: S
35
+ }) }), p[8] = b, p[9] = x, p[10] = C) : C = p[10], C;
44
36
  }
45
37
  export { EnvironmentEmbedRoot as default };
@@ -56,15 +56,15 @@ const CodeBlock = (l) => {
56
56
  let E;
57
57
  d[12] === m ? E = d[13] : (E = { code: m }, d[12] = m, d[13] = E);
58
58
  let D;
59
- d[14] === p ? D = d[15] : (D = cn("group bg-background text-foreground relative w-full overflow-hidden rounded-md border", p), d[14] = p, d[15] = D);
59
+ d[14] === p ? D = d[15] : (D = cn("group bg-background text-foreground relative min-w-0 w-full overflow-auto overscroll-contain rounded-md border", p), d[14] = p, d[15] = D);
60
60
  let O;
61
61
  d[16] === y ? O = d[17] : (O = /* @__PURE__ */ jsx("div", {
62
- className: "[&>pre]:bg-background! [&>pre]:text-foreground! overflow-x-auto dark:hidden [&_code]:font-mono [&_code]:text-sm [&>pre]:m-0 [&>pre]:p-4 [&>pre]:text-sm",
62
+ className: "[&>pre]:bg-background! [&>pre]:text-foreground! dark:hidden [&_code]:font-mono [&_code]:text-sm [&>pre]:m-0 [&>pre]:p-4 [&>pre]:text-sm",
63
63
  dangerouslySetInnerHTML: { __html: y }
64
64
  }), d[16] = y, d[17] = O);
65
65
  let k;
66
66
  d[18] === x ? k = d[19] : (k = /* @__PURE__ */ jsx("div", {
67
- className: "[&>pre]:bg-background! [&>pre]:text-foreground! hidden overflow-x-auto dark:block [&_code]:font-mono [&_code]:text-sm [&>pre]:m-0 [&>pre]:p-4 [&>pre]:text-sm",
67
+ className: "[&>pre]:bg-background! [&>pre]:text-foreground! hidden dark:block [&_code]:font-mono [&_code]:text-sm [&>pre]:m-0 [&>pre]:p-4 [&>pre]:text-sm",
68
68
  dangerouslySetInnerHTML: { __html: x }
69
69
  }), d[18] = x, d[19] = k);
70
70
  let A;
@@ -74,7 +74,7 @@ const CodeBlock = (l) => {
74
74
  }), d[20] = f, d[21] = A);
75
75
  let j;
76
76
  d[22] !== O || d[23] !== k || d[24] !== A ? (j = /* @__PURE__ */ jsxs("div", {
77
- className: "relative",
77
+ className: "relative min-w-max",
78
78
  children: [
79
79
  O,
80
80
  k,
@@ -1,8 +1,8 @@
1
1
  import { c } from "react/compiler-runtime";
2
2
  import React from "react";
3
3
  import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
4
- import Markdown from "react-markdown";
5
4
  import { Prism } from "react-syntax-highlighter";
5
+ import Markdown from "react-markdown";
6
6
  var adaptedPrism = {
7
7
  "code[class*=\"language-\"]": {
8
8
  color: "black",
@@ -1,5 +1,5 @@
1
- import CodeContent_default from "./CodeContent.js";
2
1
  import MarkdownContent_default from "./MarkdownContent.js";
2
+ import CodeContent_default from "./CodeContent.js";
3
3
  import { ObjectController } from "./ObjectController.js";
4
4
  import React from "react";
5
5
  import { jsx } from "react/jsx-runtime";
@@ -1,21 +1,20 @@
1
1
  import { useStudio, useStudioOptional } from "../../providers/StudioProvider.js";
2
- import { useFilterWorkflows } from "../../hooks/useWorkflows.js";
3
2
  import { useFilterWorkspaces } from "../../hooks/useWorkspaces.js";
4
3
  import { useComponentOverrides } from "../../providers/ComponentOverridesProvider.js";
5
4
  import { cn } from "../../lib/utils.js";
6
5
  import { Button } from "../ui/button.js";
7
- import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, useSidebar } from "../ui/sidebar.js";
6
+ import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from "../ui/sidebar.js";
8
7
  import { motion } from "../../node_modules/motion/dist/es/react.js";
9
8
  import { c } from "react/compiler-runtime";
10
9
  import { useState } from "react";
11
10
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
11
  import { Link, useLocation } from "react-router-dom";
13
- import { CircleAlert, LayoutGrid, MoreHorizontal, PanelLeftIcon, Play, Star } from "lucide-react";
12
+ import { Boxes, LayoutGrid, MoreHorizontal, PanelLeftIcon, Play, Star } from "lucide-react";
14
13
  var DefaultSidebarHeader = () => {
15
- let e = c(18), { state: u, toggleSidebar: d } = useSidebar(), [f, p] = useState(!1), g = u === "collapsed" ? "justify-center" : "justify-between", _;
16
- e[0] === g ? _ = e[1] : (_ = cn("border-sidebar-border h-12 w-full flex-row items-center border-b px-1.5 py-0", g), e[0] = g, e[1] = _);
17
- let v;
18
- e[2] === u ? v = e[3] : (v = u === "expanded" && /* @__PURE__ */ jsxs("div", {
14
+ let e = c(18), { state: o, toggleSidebar: s } = useSidebar(), [l, f] = useState(!1), p = o === "collapsed" ? "justify-center" : "justify-between", m;
15
+ e[0] === p ? m = e[1] : (m = cn("border-sidebar-border h-12 w-full flex-row items-center border-b px-1.5 py-0", p), e[0] = p, e[1] = m);
16
+ let h;
17
+ e[2] === o ? h = e[3] : (h = o === "expanded" && /* @__PURE__ */ jsxs("div", {
19
18
  className: "flex items-center gap-2 overflow-hidden px-1.5",
20
19
  children: [/* @__PURE__ */ jsx("img", {
21
20
  src: "/loopstack.svg",
@@ -45,174 +44,160 @@ var DefaultSidebarHeader = () => {
45
44
  },
46
45
  children: "Loopstack Studio"
47
46
  })]
48
- }), e[2] = u, e[3] = v);
49
- let y;
50
- e[4] === Symbol.for("react.memo_cache_sentinel") ? (y = cn("relative size-10 text-muted-foreground hover:cursor-pointer hover:bg-accent/50 hover:text-accent-foreground"), e[4] = y) : y = e[4];
51
- let b, x;
52
- e[5] === Symbol.for("react.memo_cache_sentinel") ? (b = () => p(!0), x = () => p(!1), e[5] = b, e[6] = x) : (b = e[5], x = e[6]);
53
- let C;
54
- e[7] !== f || e[8] !== u ? (C = u === "collapsed" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(motion.img, {
47
+ }), e[2] = o, e[3] = h);
48
+ let g;
49
+ e[4] === Symbol.for("react.memo_cache_sentinel") ? (g = cn("relative size-10 text-muted-foreground hover:cursor-pointer hover:bg-accent/50 hover:text-accent-foreground"), e[4] = g) : g = e[4];
50
+ let _, y;
51
+ e[5] === Symbol.for("react.memo_cache_sentinel") ? (_ = () => f(!0), y = () => f(!1), e[5] = _, e[6] = y) : (_ = e[5], y = e[6]);
52
+ let b;
53
+ e[7] !== l || e[8] !== o ? (b = o === "collapsed" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(motion.img, {
55
54
  src: "/loopstack.svg",
56
55
  alt: "Loopstack",
57
56
  className: "absolute top-1/2 left-1/2 h-5 w-5 -translate-x-1/2 -translate-y-1/2",
58
57
  initial: { opacity: 1 },
59
- animate: { opacity: f ? 0 : 1 },
58
+ animate: { opacity: l ? 0 : 1 },
60
59
  transition: { duration: .2 }
61
60
  }), /* @__PURE__ */ jsx(motion.div, {
62
61
  className: "absolute top-1/2 left-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center",
63
62
  initial: { opacity: 0 },
64
- animate: { opacity: f ? 1 : 0 },
63
+ animate: { opacity: l ? 1 : 0 },
65
64
  transition: { duration: .2 },
66
65
  children: /* @__PURE__ */ jsx(PanelLeftIcon, { className: "size-5" })
67
- })] }) : /* @__PURE__ */ jsx(PanelLeftIcon, { className: "size-5" }), e[7] = f, e[8] = u, e[9] = C) : C = e[9];
68
- let w;
69
- e[10] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ jsx("span", {
66
+ })] }) : /* @__PURE__ */ jsx(PanelLeftIcon, { className: "size-5" }), e[7] = l, e[8] = o, e[9] = b) : b = e[9];
67
+ let x;
68
+ e[10] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ jsx("span", {
70
69
  className: "sr-only",
71
70
  children: "Toggle Sidebar"
72
- }), e[10] = w) : w = e[10];
73
- let T;
74
- e[11] !== C || e[12] !== d ? (T = /* @__PURE__ */ jsxs(Button, {
71
+ }), e[10] = x) : x = e[10];
72
+ let E;
73
+ e[11] !== b || e[12] !== s ? (E = /* @__PURE__ */ jsxs(Button, {
75
74
  "data-sidebar": "trigger",
76
75
  "data-slot": "sidebar-trigger",
77
76
  variant: "ghost",
78
77
  size: "icon",
79
- className: y,
80
- onClick: d,
81
- onMouseEnter: b,
82
- onMouseLeave: x,
83
- children: [C, w]
84
- }), e[11] = C, e[12] = d, e[13] = T) : T = e[13];
85
- let E;
86
- return e[14] !== _ || e[15] !== v || e[16] !== T ? (E = /* @__PURE__ */ jsxs(SidebarHeader, {
87
- className: _,
88
- children: [v, T]
89
- }), e[14] = _, e[15] = v, e[16] = T, e[17] = E) : E = e[17], E;
90
- }, RunsNav = () => {
91
- let u = c(26), f = useLocation(), { router: p } = useStudio(), m = p.getRuns(), h;
92
- u[0] === p ? h = u[1] : (h = p.getRunsActionRequired(), u[0] = p, u[1] = h);
93
- let g = h, _;
94
- u[2] === Symbol.for("react.memo_cache_sentinel") ? (_ = {
95
- parentId: null,
96
- status: "paused"
97
- }, u[2] = _) : _ = u[2];
98
- let v = useFilterWorkflows(void 0, _, "createdAt", "DESC", 0, 1).data?.total ?? 0, S;
99
- u[3] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Runs" }), u[3] = S) : S = u[3];
100
- let D = f.pathname === m || f.pathname === m + "/", O, k;
101
- u[4] === Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ jsx(Play, {}), k = /* @__PURE__ */ jsx("span", { children: "Overview" }), u[4] = O, u[5] = k) : (O = u[4], k = u[5]);
102
- let A;
103
- u[6] === m ? A = u[7] : (A = /* @__PURE__ */ jsxs(Link, {
104
- to: m,
105
- children: [O, k]
106
- }), u[6] = m, u[7] = A);
78
+ className: g,
79
+ onClick: s,
80
+ onMouseEnter: _,
81
+ onMouseLeave: y,
82
+ children: [b, x]
83
+ }), e[11] = b, e[12] = s, e[13] = E) : E = e[13];
84
+ let D;
85
+ return e[14] !== m || e[15] !== h || e[16] !== E ? (D = /* @__PURE__ */ jsxs(SidebarHeader, {
86
+ className: m,
87
+ children: [h, E]
88
+ }), e[14] = m, e[15] = h, e[16] = E, e[17] = D) : D = e[17], D;
89
+ }, MainNav = () => {
90
+ let o = c(29), s = useLocation(), { router: l } = useStudio(), u;
91
+ o[0] === l ? u = o[1] : (u = l.getDashboard(), o[0] = l, o[1] = u);
92
+ let d = u, f;
93
+ o[2] === l ? f = o[3] : (f = l.getWorkspaces(), o[2] = l, o[3] = f);
94
+ let p = f, m = l.getRuns(), _ = s.pathname === d, v, S;
95
+ o[4] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ jsx(Boxes, {}), S = /* @__PURE__ */ jsx("span", { children: "Applications" }), o[4] = v, o[5] = S) : (v = o[4], S = o[5]);
96
+ let C;
97
+ o[6] === d ? C = o[7] : (C = /* @__PURE__ */ jsxs(Link, {
98
+ to: d,
99
+ children: [v, S]
100
+ }), o[6] = d, o[7] = C);
101
+ let w;
102
+ o[8] !== _ || o[9] !== C ? (w = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
103
+ asChild: !0,
104
+ isActive: _,
105
+ tooltip: "Applications",
106
+ children: C
107
+ }) }), o[8] = _, o[9] = C, o[10] = w) : w = o[10];
108
+ let T = s.pathname === p, k, A;
109
+ o[11] === Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ jsx(LayoutGrid, {}), A = /* @__PURE__ */ jsx("span", { children: "Workspaces" }), o[11] = k, o[12] = A) : (k = o[11], A = o[12]);
107
110
  let j;
108
- u[8] !== D || u[9] !== A ? (j = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
111
+ o[13] === p ? j = o[14] : (j = /* @__PURE__ */ jsxs(Link, {
112
+ to: p,
113
+ children: [k, A]
114
+ }), o[13] = p, o[14] = j);
115
+ let M;
116
+ o[15] !== j || o[16] !== T ? (M = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
109
117
  asChild: !0,
110
- isActive: D,
111
- tooltip: "Overview",
112
- children: A
113
- }) }), u[8] = D, u[9] = A, u[10] = j) : j = u[10];
114
- let M = f.pathname === g, N, P;
115
- u[11] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ jsx(CircleAlert, {}), N = /* @__PURE__ */ jsx("span", { children: "Action Required" }), u[11] = N, u[12] = P) : (N = u[11], P = u[12]);
116
- let F;
117
- u[13] === g ? F = u[14] : (F = /* @__PURE__ */ jsxs(Link, {
118
- to: g,
119
- children: [P, N]
120
- }), u[13] = g, u[14] = F);
118
+ isActive: T,
119
+ tooltip: "Workspaces",
120
+ children: j
121
+ }) }), o[15] = j, o[16] = T, o[17] = M) : M = o[17];
122
+ let N = s.pathname === m || s.pathname === m + "/", P, F;
123
+ o[18] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ jsx(Play, {}), F = /* @__PURE__ */ jsx("span", { children: "Runs" }), o[18] = P, o[19] = F) : (P = o[18], F = o[19]);
121
124
  let I;
122
- u[15] !== F || u[16] !== M ? (I = /* @__PURE__ */ jsx(SidebarMenuButton, {
123
- asChild: !0,
124
- isActive: M,
125
- tooltip: "Action Required",
126
- children: F
127
- }), u[15] = F, u[16] = M, u[17] = I) : I = u[17];
128
- let L;
129
- u[18] === v ? L = u[19] : (L = v > 0 && /* @__PURE__ */ jsx(SidebarMenuBadge, { children: v }), u[18] = v, u[19] = L);
130
- let R;
131
- u[20] !== I || u[21] !== L ? (R = /* @__PURE__ */ jsxs(SidebarMenuItem, { children: [I, L] }), u[20] = I, u[21] = L, u[22] = R) : R = u[22];
132
- let z;
133
- return u[23] !== R || u[24] !== j ? (z = /* @__PURE__ */ jsxs(SidebarGroup, { children: [S, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsxs(SidebarMenu, { children: [j, R] }) })] }), u[23] = R, u[24] = j, u[25] = z) : z = u[25], z;
134
- }, WorkspacesNav = () => {
135
- let u = c(10), d = useLocation(), { router: f } = useStudio(), p;
136
- u[0] === f ? p = u[1] : (p = f.getWorkspaces(), u[0] = f, u[1] = p);
137
- let m = p, h;
138
- u[2] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Workspaces" }), u[2] = h) : h = u[2];
139
- let g = d.pathname === m, _, v;
140
- u[3] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ jsx(LayoutGrid, {}), v = /* @__PURE__ */ jsx("span", { children: "Workspaces" }), u[3] = _, u[4] = v) : (_ = u[3], v = u[4]);
141
- let S;
142
- u[5] === m ? S = u[6] : (S = /* @__PURE__ */ jsxs(Link, {
125
+ o[20] === m ? I = o[21] : (I = /* @__PURE__ */ jsxs(Link, {
143
126
  to: m,
144
- children: [_, v]
145
- }), u[5] = m, u[6] = S);
146
- let w;
147
- return u[7] !== g || u[8] !== S ? (w = /* @__PURE__ */ jsxs(SidebarGroup, { children: [h, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
127
+ children: [P, F]
128
+ }), o[20] = m, o[21] = I);
129
+ let L;
130
+ o[22] !== N || o[23] !== I ? (L = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
148
131
  asChild: !0,
149
- isActive: g,
150
- tooltip: "Workspaces",
151
- children: S
152
- }) }) }) })] }), u[7] = g, u[8] = S, u[9] = w) : w = u[9], w;
132
+ isActive: N,
133
+ tooltip: "Runs",
134
+ children: I
135
+ }) }), o[22] = N, o[23] = I, o[24] = L) : L = o[24];
136
+ let R;
137
+ return o[25] !== M || o[26] !== L || o[27] !== w ? (R = /* @__PURE__ */ jsx(SidebarGroup, { children: /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsxs(SidebarMenu, { children: [
138
+ w,
139
+ M,
140
+ L
141
+ ] }) }) }), o[25] = M, o[26] = L, o[27] = w, o[28] = R) : R = o[28], R;
153
142
  }, FavouritesNav = () => {
154
- let u = c(19), d = useLocation(), { router: p } = useStudio(), m;
155
- u[0] === p ? m = u[1] : (m = p.getWorkspaces(), u[0] = p, u[1] = m);
156
- let h = m, g;
157
- u[2] === Symbol.for("react.memo_cache_sentinel") ? (g = { isFavourite: "true" }, u[2] = g) : g = u[2];
158
- let _ = useFilterWorkspaces(void 0, g, "createdAt", "ASC", 0, 10), v;
159
- u[3] === _.data?.data ? v = u[4] : (v = _.data?.data ?? [], u[3] = _.data?.data, u[4] = v);
143
+ let o = c(19), l = useLocation(), { router: u } = useStudio(), d;
144
+ o[0] === u ? d = o[1] : (d = u.getWorkspaces(), o[0] = u, o[1] = d);
145
+ let f = d, p;
146
+ o[2] === Symbol.for("react.memo_cache_sentinel") ? (p = { isFavourite: "true" }, o[2] = p) : p = o[2];
147
+ let m = useFilterWorkspaces(void 0, p, "createdAt", "ASC", 0, 10), v;
148
+ o[3] === m.data?.data ? v = o[4] : (v = m.data?.data ?? [], o[3] = m.data?.data, o[4] = v);
160
149
  let S = v;
161
150
  if (S.length === 0) return null;
151
+ let C;
152
+ o[5] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Favourites" }), o[5] = C) : C = o[5];
162
153
  let w;
163
- u[5] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Favourites" }), u[5] = w) : w = u[5];
164
- let D;
165
- if (u[6] !== S || u[7] !== d || u[8] !== p) {
154
+ if (o[6] !== S || o[7] !== l || o[8] !== u) {
166
155
  let e;
167
- u[10] !== d || u[11] !== p ? (e = (e) => {
168
- let u = p.getWorkspace(e.id);
156
+ o[10] !== l || o[11] !== u ? (e = (e) => {
157
+ let o = u.getWorkspace(e.id);
169
158
  return /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
170
159
  asChild: !0,
171
- isActive: d.pathname === u || d.pathname.startsWith(u + "/"),
160
+ isActive: l.pathname === o || l.pathname.startsWith(o + "/"),
172
161
  tooltip: e.title,
173
162
  children: /* @__PURE__ */ jsxs(Link, {
174
- to: u,
163
+ to: o,
175
164
  children: [/* @__PURE__ */ jsx(Star, { className: "h-4 w-4" }), /* @__PURE__ */ jsx("span", { children: e.title })]
176
165
  })
177
166
  }) }, e.id);
178
- }, u[10] = d, u[11] = p, u[12] = e) : e = u[12], D = S.map(e), u[6] = S, u[7] = d, u[8] = p, u[9] = D;
179
- } else D = u[9];
180
- let O;
181
- u[13] !== _.data?.total || u[14] !== h ? (O = (_.data?.total ?? 0) > 10 && /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
167
+ }, o[10] = l, o[11] = u, o[12] = e) : e = o[12], w = S.map(e), o[6] = S, o[7] = l, o[8] = u, o[9] = w;
168
+ } else w = o[9];
169
+ let T;
170
+ o[13] !== m.data?.total || o[14] !== f ? (T = (m.data?.total ?? 0) > 10 && /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
182
171
  asChild: !0,
183
172
  tooltip: "More favourites",
184
173
  children: /* @__PURE__ */ jsxs(Link, {
185
- to: h,
174
+ to: f,
186
175
  children: [/* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }), /* @__PURE__ */ jsx("span", { children: "More" })]
187
176
  })
188
- }) }), u[13] = _.data?.total, u[14] = h, u[15] = O) : O = u[15];
189
- let k;
190
- return u[16] !== D || u[17] !== O ? (k = /* @__PURE__ */ jsxs(SidebarGroup, { children: [w, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsxs(SidebarMenu, { children: [D, O] }) })] }), u[16] = D, u[17] = O, u[18] = k) : k = u[18], k;
177
+ }) }), o[13] = m.data?.total, o[14] = f, o[15] = T) : T = o[15];
178
+ let O;
179
+ return o[16] !== w || o[17] !== T ? (O = /* @__PURE__ */ jsxs(SidebarGroup, { children: [C, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsxs(SidebarMenu, { children: [w, T] }) })] }), o[16] = w, o[17] = T, o[18] = O) : O = o[18], O;
191
180
  }, DefaultSidebarFooter = () => {
192
- let e = c(1), u;
193
- return e[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ jsx(SidebarFooter, {}), e[0] = u) : u = e[0], u;
181
+ let e = c(1), o;
182
+ return e[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ jsx(SidebarFooter, {}), e[0] = o) : o = e[0], o;
194
183
  };
195
184
  const StudioSidebar = () => {
196
- let e = c(13), d = useComponentOverrides(), f = useStudioOptional(), m = d.SidebarHeader ?? DefaultSidebarHeader, h = d.SidebarFooter ?? DefaultSidebarFooter, v;
197
- e[0] === m ? v = e[1] : (v = /* @__PURE__ */ jsx(m, {}), e[0] = m, e[1] = v);
185
+ let e = c(13), s = useComponentOverrides(), u = useStudioOptional(), d = s.SidebarHeader ?? DefaultSidebarHeader, m = s.SidebarFooter ?? DefaultSidebarFooter, h;
186
+ e[0] === d ? h = e[1] : (h = /* @__PURE__ */ jsx(d, {}), e[0] = d, e[1] = h);
187
+ let g;
188
+ e[2] === u ? g = e[3] : (g = u && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MainNav, {}), /* @__PURE__ */ jsx(FavouritesNav, {})] }), e[2] = u, e[3] = g);
189
+ let _;
190
+ e[4] === g ? _ = e[5] : (_ = /* @__PURE__ */ jsx(SidebarContent, { children: g }), e[4] = g, e[5] = _);
191
+ let v;
192
+ e[6] !== m || e[7] !== u ? (v = u && /* @__PURE__ */ jsx(m, {}), e[6] = m, e[7] = u, e[8] = v) : v = e[8];
198
193
  let y;
199
- e[2] === f ? y = e[3] : (y = f && /* @__PURE__ */ jsxs(Fragment$1, { children: [
200
- /* @__PURE__ */ jsx(RunsNav, {}),
201
- /* @__PURE__ */ jsx(WorkspacesNav, {}),
202
- /* @__PURE__ */ jsx(FavouritesNav, {})
203
- ] }), e[2] = f, e[3] = y);
204
- let b;
205
- e[4] === y ? b = e[5] : (b = /* @__PURE__ */ jsx(SidebarContent, { children: y }), e[4] = y, e[5] = b);
206
- let x;
207
- e[6] !== h || e[7] !== f ? (x = f && /* @__PURE__ */ jsx(h, {}), e[6] = h, e[7] = f, e[8] = x) : x = e[8];
208
- let S;
209
- return e[9] !== v || e[10] !== b || e[11] !== x ? (S = /* @__PURE__ */ jsxs(Sidebar, {
194
+ return e[9] !== h || e[10] !== _ || e[11] !== v ? (y = /* @__PURE__ */ jsxs(Sidebar, {
210
195
  collapsible: "icon",
211
196
  children: [
212
- v,
213
- b,
214
- x
197
+ h,
198
+ _,
199
+ v
215
200
  ]
216
- }), e[9] = v, e[10] = b, e[11] = x, e[12] = S) : S = e[12], S;
201
+ }), e[9] = h, e[10] = _, e[11] = v, e[12] = y) : y = e[12], y;
217
202
  };
218
203
  export { StudioSidebar };