@loopstack/loopstack-studio 0.34.0 → 0.35.1

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 (133) hide show
  1. package/dist/app/EnvironmentEmbedRoot.js +18 -24
  2. package/dist/components/layout/StudioSidebar.js +34 -34
  3. package/dist/events/api-client-events.js +13 -1
  4. package/dist/events/index.js +1 -0
  5. package/dist/features/code-explorer/components/FileTabsBarBase.js +1 -1
  6. package/dist/features/code-explorer/index.js +0 -3
  7. package/dist/features/dashboard/AppLauncher.js +1 -1
  8. package/dist/features/debug/components/WorkflowFlowViewer.js +2 -1
  9. package/dist/features/debug/components/workflow-flow/WorkflowGraph.js +2 -1
  10. package/dist/features/documents/components/DocumentList.js +1 -1
  11. package/dist/features/documents/document-details/DocumentDetails.js +0 -5
  12. package/dist/features/documents/renderers/DocumentFormRenderer.js +13 -12
  13. package/dist/features/documents/renderers/LinkMessageRenderer.js +2 -1
  14. package/dist/features/documents/renderers/useDocumentTransition.js +3 -2
  15. package/dist/features/feature-registry/FeatureRegistryProvider.js +2 -1
  16. package/dist/features/file-explorer/components/FileTabsBar.js +1 -1
  17. package/dist/features/file-explorer/components/FileTree.js +1 -1
  18. package/dist/features/file-explorer/hooks/useFileExplorer.js +36 -31
  19. package/dist/features/file-explorer/providers/FileExplorerProvider.js +94 -92
  20. package/dist/features/git/components/WorkbenchGitPanel.js +6 -9
  21. package/dist/features/git/hooks/useGit.js +55 -57
  22. package/dist/features/health/LocalHealthCheck.js +46 -47
  23. package/dist/features/oauth/OAuthPromptRenderer.js +6 -5
  24. package/dist/features/runs/Runs.js +3 -2
  25. package/dist/features/secrets/renderers/SecretInputRenderer.js +3 -2
  26. package/dist/features/workbench/WorkflowItem.js +5 -8
  27. package/dist/features/workbench/components/NewRunDialog.js +172 -170
  28. package/dist/features/workbench/components/PreviewEmptyState.js +1 -1
  29. package/dist/features/workbench/components/WorkbenchRunsPanel.js +2 -1
  30. package/dist/features/workbench/components/WorkflowForms.js +1 -1
  31. package/dist/features/workbench/components/WorkflowHistoryItem.js +2 -1
  32. package/dist/features/workbench/components/buttons/WorkflowButtons.js +8 -14
  33. package/dist/features/workbench/hooks/useLlmStreamingDocuments.js +65 -132
  34. package/dist/features/workbench/hooks/useWorkflowData.js +8 -6
  35. package/dist/features/workspaces/Workspaces.js +4 -2
  36. package/dist/features/workspaces/components/CreateWorkspace.js +7 -5
  37. package/dist/features/workspaces/components/ExecutionTimeline.js +69 -65
  38. package/dist/features/workspaces/components/WorkflowRunForm.js +6 -4
  39. package/dist/features/workspaces/components/WorkspaceHomePage.js +1 -1
  40. package/dist/hooks/index.js +5 -5
  41. package/dist/hooks/useAuth.js +14 -53
  42. package/dist/hooks/useConfig.js +13 -37
  43. package/dist/hooks/useDocuments.js +5 -30
  44. package/dist/hooks/useEnvironments.js +34 -24
  45. package/dist/hooks/useProcessor.js +2 -31
  46. package/dist/hooks/useSecrets.js +78 -24
  47. package/dist/hooks/useWorkflows.js +43 -172
  48. package/dist/hooks/useWorkspaces.js +24 -130
  49. package/dist/index.d.ts +130 -488
  50. package/dist/index.js +10 -12
  51. package/dist/packages/client/dist/client.js +35 -0
  52. package/dist/packages/client/dist/http.js +47 -0
  53. package/dist/packages/client/dist/index.js +15 -0
  54. package/dist/packages/client/dist/queries/query-keys.js +94 -0
  55. package/dist/packages/client/dist/queries/query-options.js +97 -0
  56. package/dist/packages/client/dist/resources/auth.js +10 -0
  57. package/dist/packages/client/dist/resources/config.js +11 -0
  58. package/dist/packages/client/dist/resources/dashboard.js +4 -0
  59. package/dist/packages/client/dist/resources/documents.js +7 -0
  60. package/dist/packages/client/dist/resources/processor.js +7 -0
  61. package/dist/packages/client/dist/resources/workflows.js +13 -0
  62. package/dist/packages/client/dist/resources/workspaces.js +12 -0
  63. package/dist/packages/client/dist/stream/invalidations.js +20 -0
  64. package/dist/packages/client/dist/stream/llm-reducer.js +65 -0
  65. package/dist/packages/client/dist/stream/sse-parser.js +40 -0
  66. package/dist/packages/client/dist/stream/stream.js +147 -0
  67. package/dist/packages/contracts/dist/events/client-message-base.schema.js +6 -0
  68. package/dist/packages/contracts/dist/events/client-message.schema.js +24 -0
  69. package/dist/packages/contracts/dist/events/index.js +6 -0
  70. package/dist/packages/contracts/dist/events/llm-events.schema.js +44 -0
  71. package/dist/packages/contracts/dist/events/stream-events.schema.js +4 -0
  72. package/dist/packages/contracts/dist/events/workflow-events.schema.js +20 -0
  73. package/dist/packages/contracts/dist/events/workspace-events.schema.js +5 -0
  74. package/dist/packages/contracts/dist/types/types/ui-message.type.js +39 -0
  75. package/dist/packages/react/dist/hooks/mutations.js +175 -0
  76. package/dist/packages/react/dist/hooks/queries.js +139 -0
  77. package/dist/packages/react/dist/hooks/use-live-invalidation.js +39 -0
  78. package/dist/packages/react/dist/hooks/use-llm-stream.js +18 -0
  79. package/dist/packages/react/dist/index.js +5 -0
  80. package/dist/packages/react/dist/provider.js +15 -0
  81. package/dist/pages/DashboardPage.js +2 -1
  82. package/dist/pages/DebugWorkflowDetailsPage.js +2 -1
  83. package/dist/pages/DebugWorkflowsPage.js +2 -1
  84. package/dist/pages/EmbedWorkbenchPage.js +5 -4
  85. package/dist/pages/PreviewWorkbenchPage.js +60 -59
  86. package/dist/pages/StudioLandingPage.js +1 -1
  87. package/dist/pages/WorkbenchPage.js +3 -2
  88. package/dist/pages/WorkflowDebugPage.js +3 -2
  89. package/dist/pages/WorkspacePage.js +3 -2
  90. package/dist/pages/WorkspaceRunsPage.js +2 -1
  91. package/dist/providers/LoopstackClientProvider.js +35 -0
  92. package/dist/services/createApiClient.js +9 -3
  93. package/dist/services/index.js +0 -1
  94. package/dist/services/reporting-fetch.js +13 -0
  95. package/package.json +4 -3
  96. package/dist/api/auth.js +0 -10
  97. package/dist/api/client.js +0 -13
  98. package/dist/api/config.js +0 -11
  99. package/dist/api/dashboard.js +0 -4
  100. package/dist/api/documents.js +0 -7
  101. package/dist/api/environments.js +0 -8
  102. package/dist/api/index.js +0 -31
  103. package/dist/api/processor.js +0 -7
  104. package/dist/api/secrets.js +0 -16
  105. package/dist/api/workflows.js +0 -15
  106. package/dist/api/workspaces.js +0 -12
  107. package/dist/events/sse-client-events.js +0 -15
  108. package/dist/features/code-explorer/CodeExplorer.js +0 -6
  109. package/dist/features/code-explorer/components/CodeExplorerTree.js +0 -6
  110. package/dist/features/code-explorer/components/FileTabsBar.js +0 -4
  111. package/dist/features/code-explorer/providers/CodeExplorerProvider.js +0 -5
  112. package/dist/features/file-explorer/api/files.js +0 -12
  113. package/dist/features/git/api/git.js +0 -9
  114. package/dist/hooks/query-keys.js +0 -145
  115. package/dist/hooks/useApi.js +0 -15
  116. package/dist/hooks/useFiles.js +0 -3
  117. package/dist/node_modules/lodash/_Symbol.js +0 -7
  118. package/dist/node_modules/lodash/_baseGetTag.js +0 -13
  119. package/dist/node_modules/lodash/_baseTrim.js +0 -11
  120. package/dist/node_modules/lodash/_freeGlobal.js +0 -6
  121. package/dist/node_modules/lodash/_getRawTag.js +0 -17
  122. package/dist/node_modules/lodash/_objectToString.js +0 -10
  123. package/dist/node_modules/lodash/_root.js +0 -8
  124. package/dist/node_modules/lodash/_trimmedEndIndex.js +0 -11
  125. package/dist/node_modules/lodash/debounce.js +0 -53
  126. package/dist/node_modules/lodash/isObject.js +0 -10
  127. package/dist/node_modules/lodash/isObjectLike.js +0 -9
  128. package/dist/node_modules/lodash/isSymbol.js +0 -12
  129. package/dist/node_modules/lodash/now.js +0 -10
  130. package/dist/node_modules/lodash/toNumber.js +0 -22
  131. package/dist/providers/InvalidationEventsProvider.js +0 -43
  132. package/dist/providers/SseProvider.js +0 -37
  133. package/dist/services/eventEmitter.js +0 -12
@@ -1,6 +1,5 @@
1
1
  import { StudioProvider } from "../providers/StudioProvider.js";
2
- import { SseProvider } from "../providers/SseProvider.js";
3
- import { InvalidationEventsProvider } from "../providers/InvalidationEventsProvider.js";
2
+ import { LoopstackClientProvider } from "../providers/LoopstackClientProvider.js";
4
3
  import { useRouter } from "../routing/LocalRouter.js";
5
4
  import LocalHealthCheck_default from "../features/health/LocalHealthCheck.js";
6
5
  import { QueryProvider } from "../providers/QueryProvider.js";
@@ -8,28 +7,23 @@ import { c } from "react/compiler-runtime";
8
7
  import { jsx, jsxs } from "react/jsx-runtime";
9
8
  import { Outlet, useSearchParams } from "react-router-dom";
10
9
  function EnvironmentEmbedRoot() {
11
- let f = c(14), [p] = useSearchParams(), m;
12
- f[0] === p ? m = f[1] : (m = p.get("url") ?? "http://localhost:3080", f[0] = p, f[1] = m);
13
- let h = m, g;
14
- f[2] === p ? g = f[3] : (g = p.get("name") ?? "Preview Environment", f[2] = p, f[3] = g);
15
- let _ = g, v;
16
- f[4] !== _ || f[5] !== h ? (v = {
10
+ let d = c(11), [f] = useSearchParams(), p;
11
+ d[0] === f ? p = d[1] : (p = f.get("url") ?? "http://localhost:3080", d[0] = f, d[1] = p);
12
+ let m = p, h;
13
+ d[2] === f ? h = d[3] : (h = f.get("name") ?? "Preview Environment", d[2] = f, d[3] = h);
14
+ let g = h, _;
15
+ d[4] !== g || d[5] !== m ? (_ = {
17
16
  id: "preview-env",
18
- name: _,
19
- url: h
20
- }, f[4] = _, f[5] = h, f[6] = v) : v = f[6];
21
- let y = v, b = useRouter(y.id, "/embed/env"), x, S, C, w;
22
- f[7] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ jsx(LocalHealthCheck_default, {}), S = /* @__PURE__ */ jsx(SseProvider, {}), C = /* @__PURE__ */ jsx(InvalidationEventsProvider, {}), w = /* @__PURE__ */ jsx(Outlet, {}), f[7] = x, f[8] = S, f[9] = C, f[10] = w) : (x = f[7], S = f[8], C = f[9], w = f[10]);
23
- let T;
24
- return f[11] !== y || f[12] !== b ? (T = /* @__PURE__ */ jsx(QueryProvider, { children: /* @__PURE__ */ jsxs(StudioProvider, {
25
- router: b,
26
- environment: y,
27
- children: [
28
- x,
29
- S,
30
- C,
31
- w
32
- ]
33
- }) }), f[11] = y, f[12] = b, f[13] = T) : T = f[13], T;
17
+ name: g,
18
+ url: m
19
+ }, d[4] = g, d[5] = m, d[6] = _) : _ = d[6];
20
+ let v = _, y = useRouter(v.id, "/embed/env"), b;
21
+ d[7] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ jsxs(LoopstackClientProvider, { children: [/* @__PURE__ */ jsx(LocalHealthCheck_default, {}), /* @__PURE__ */ jsx(Outlet, {})] }), d[7] = b) : b = d[7];
22
+ let x;
23
+ return d[8] !== v || d[9] !== y ? (x = /* @__PURE__ */ jsx(QueryProvider, { children: /* @__PURE__ */ jsx(StudioProvider, {
24
+ router: y,
25
+ environment: v,
26
+ children: b
27
+ }) }), d[8] = v, d[9] = y, d[10] = x) : x = d[10], x;
34
28
  }
35
29
  export { EnvironmentEmbedRoot as default };
@@ -1,5 +1,5 @@
1
- import { useStudio, useStudioOptional } from "../../providers/StudioProvider.js";
2
1
  import { useFilterWorkspaces } from "../../hooks/useWorkspaces.js";
2
+ import { useStudio, useStudioOptional } from "../../providers/StudioProvider.js";
3
3
  import { useComponentOverrides } from "../../providers/ComponentOverridesProvider.js";
4
4
  import { cn } from "../../lib/utils.js";
5
5
  import { Button } from "../ui/button.js";
@@ -87,73 +87,73 @@ var DefaultSidebarHeader = () => {
87
87
  children: [h, E]
88
88
  }), e[14] = m, e[15] = h, e[16] = E, e[17] = D) : D = e[17], D;
89
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);
90
+ let e = c(29), s = useLocation(), { router: l } = useStudio(), u;
91
+ e[0] === l ? u = e[1] : (u = l.getDashboard(), e[0] = l, e[1] = u);
92
92
  let d = u, f;
93
- o[2] === l ? f = o[3] : (f = l.getWorkspaces(), o[2] = l, o[3] = f);
93
+ e[2] === l ? f = e[3] : (f = l.getWorkspaces(), e[2] = l, e[3] = f);
94
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]);
95
+ e[4] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ jsx(Boxes, {}), S = /* @__PURE__ */ jsx("span", { children: "Applications" }), e[4] = v, e[5] = S) : (v = e[4], S = e[5]);
96
96
  let C;
97
- o[6] === d ? C = o[7] : (C = /* @__PURE__ */ jsxs(Link, {
97
+ e[6] === d ? C = e[7] : (C = /* @__PURE__ */ jsxs(Link, {
98
98
  to: d,
99
99
  children: [v, S]
100
- }), o[6] = d, o[7] = C);
100
+ }), e[6] = d, e[7] = C);
101
101
  let w;
102
- o[8] !== _ || o[9] !== C ? (w = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
102
+ e[8] !== _ || e[9] !== C ? (w = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
103
103
  asChild: !0,
104
104
  isActive: _,
105
105
  tooltip: "Applications",
106
106
  children: C
107
- }) }), o[8] = _, o[9] = C, o[10] = w) : w = o[10];
107
+ }) }), e[8] = _, e[9] = C, e[10] = w) : w = e[10];
108
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]);
109
+ e[11] === Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ jsx(LayoutGrid, {}), A = /* @__PURE__ */ jsx("span", { children: "Workspaces" }), e[11] = k, e[12] = A) : (k = e[11], A = e[12]);
110
110
  let j;
111
- o[13] === p ? j = o[14] : (j = /* @__PURE__ */ jsxs(Link, {
111
+ e[13] === p ? j = e[14] : (j = /* @__PURE__ */ jsxs(Link, {
112
112
  to: p,
113
113
  children: [k, A]
114
- }), o[13] = p, o[14] = j);
114
+ }), e[13] = p, e[14] = j);
115
115
  let M;
116
- o[15] !== j || o[16] !== T ? (M = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
116
+ e[15] !== j || e[16] !== T ? (M = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
117
117
  asChild: !0,
118
118
  isActive: T,
119
119
  tooltip: "Workspaces",
120
120
  children: j
121
- }) }), o[15] = j, o[16] = T, o[17] = M) : M = o[17];
121
+ }) }), e[15] = j, e[16] = T, e[17] = M) : M = e[17];
122
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]);
123
+ e[18] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ jsx(Play, {}), F = /* @__PURE__ */ jsx("span", { children: "Runs" }), e[18] = P, e[19] = F) : (P = e[18], F = e[19]);
124
124
  let I;
125
- o[20] === m ? I = o[21] : (I = /* @__PURE__ */ jsxs(Link, {
125
+ e[20] === m ? I = e[21] : (I = /* @__PURE__ */ jsxs(Link, {
126
126
  to: m,
127
127
  children: [P, F]
128
- }), o[20] = m, o[21] = I);
128
+ }), e[20] = m, e[21] = I);
129
129
  let L;
130
- o[22] !== N || o[23] !== I ? (L = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
130
+ e[22] !== N || e[23] !== I ? (L = /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
131
131
  asChild: !0,
132
132
  isActive: N,
133
133
  tooltip: "Runs",
134
134
  children: I
135
- }) }), o[22] = N, o[23] = I, o[24] = L) : L = o[24];
135
+ }) }), e[22] = N, e[23] = I, e[24] = L) : L = e[24];
136
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: [
137
+ return e[25] !== M || e[26] !== L || e[27] !== w ? (R = /* @__PURE__ */ jsx(SidebarGroup, { children: /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsxs(SidebarMenu, { children: [
138
138
  w,
139
139
  M,
140
140
  L
141
- ] }) }) }), o[25] = M, o[26] = L, o[27] = w, o[28] = R) : R = o[28], R;
141
+ ] }) }) }), e[25] = M, e[26] = L, e[27] = w, e[28] = R) : R = e[28], R;
142
142
  }, FavouritesNav = () => {
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);
143
+ let s = c(19), l = useLocation(), { router: u } = useStudio(), d;
144
+ s[0] === u ? d = s[1] : (d = u.getWorkspaces(), s[0] = u, s[1] = d);
145
145
  let f = d, p;
146
- o[2] === Symbol.for("react.memo_cache_sentinel") ? (p = { isFavourite: "true" }, o[2] = p) : p = o[2];
146
+ s[2] === Symbol.for("react.memo_cache_sentinel") ? (p = { isFavourite: "true" }, s[2] = p) : p = s[2];
147
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);
148
+ s[3] === m.data?.data ? v = s[4] : (v = m.data?.data ?? [], s[3] = m.data?.data, s[4] = v);
149
149
  let S = v;
150
150
  if (S.length === 0) return null;
151
151
  let C;
152
- o[5] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Favourites" }), o[5] = C) : C = o[5];
152
+ s[5] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(SidebarGroupLabel, { children: "Favourites" }), s[5] = C) : C = s[5];
153
153
  let w;
154
- if (o[6] !== S || o[7] !== l || o[8] !== u) {
154
+ if (s[6] !== S || s[7] !== l || s[8] !== u) {
155
155
  let e;
156
- o[10] !== l || o[11] !== u ? (e = (e) => {
156
+ s[10] !== l || s[11] !== u ? (e = (e) => {
157
157
  let o = u.getWorkspace(e.id);
158
158
  return /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
159
159
  asChild: !0,
@@ -164,25 +164,25 @@ var DefaultSidebarHeader = () => {
164
164
  children: [/* @__PURE__ */ jsx(Star, { className: "h-4 w-4" }), /* @__PURE__ */ jsx("span", { children: e.title })]
165
165
  })
166
166
  }) }, e.id);
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];
167
+ }, s[10] = l, s[11] = u, s[12] = e) : e = s[12], w = S.map(e), s[6] = S, s[7] = l, s[8] = u, s[9] = w;
168
+ } else w = s[9];
169
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, {
170
+ s[13] !== m.data?.total || s[14] !== f ? (T = (m.data?.total ?? 0) > 10 && /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsx(SidebarMenuButton, {
171
171
  asChild: !0,
172
172
  tooltip: "More favourites",
173
173
  children: /* @__PURE__ */ jsxs(Link, {
174
174
  to: f,
175
175
  children: [/* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }), /* @__PURE__ */ jsx("span", { children: "More" })]
176
176
  })
177
- }) }), o[13] = m.data?.total, o[14] = f, o[15] = T) : T = o[15];
177
+ }) }), s[13] = m.data?.total, s[14] = f, s[15] = T) : T = s[15];
178
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;
179
+ return s[16] !== w || s[17] !== T ? (O = /* @__PURE__ */ jsxs(SidebarGroup, { children: [C, /* @__PURE__ */ jsx(SidebarGroupContent, { children: /* @__PURE__ */ jsxs(SidebarMenu, { children: [w, T] }) })] }), s[16] = w, s[17] = T, s[18] = O) : O = s[18], O;
180
180
  }, DefaultSidebarFooter = () => {
181
181
  let e = c(1), o;
182
182
  return e[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ jsx(SidebarFooter, {}), e[0] = o) : o = e[0], o;
183
183
  };
184
184
  const StudioSidebar = () => {
185
- let e = c(13), s = useComponentOverrides(), u = useStudioOptional(), d = s.SidebarHeader ?? DefaultSidebarHeader, m = s.SidebarFooter ?? DefaultSidebarFooter, h;
185
+ let e = c(13), o = useComponentOverrides(), u = useStudioOptional(), d = o.SidebarHeader ?? DefaultSidebarHeader, m = o.SidebarFooter ?? DefaultSidebarFooter, h;
186
186
  e[0] === d ? h = e[1] : (h = /* @__PURE__ */ jsx(d, {}), e[0] = d, e[1] = h);
187
187
  let g;
188
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);
@@ -2,4 +2,16 @@ const ApiClientEvents = {
2
2
  UNAUTHORIZED: "api.unauthorized",
3
3
  ERR_NETWORK: "api.ERR_NETWORK"
4
4
  };
5
- export { ApiClientEvents };
5
+ function createApiClientEventEmitter() {
6
+ let e = /* @__PURE__ */ new Map();
7
+ return {
8
+ on(t, n) {
9
+ return e.has(t) || e.set(t, /* @__PURE__ */ new Set()), e.get(t).add(n), () => e.get(t)?.delete(n);
10
+ },
11
+ emit(t, n) {
12
+ for (let r of e.get(t) ?? []) r(n);
13
+ }
14
+ };
15
+ }
16
+ const apiClientEvents = createApiClientEventEmitter();
17
+ export { ApiClientEvents, apiClientEvents };
@@ -0,0 +1 @@
1
+ import { ApiClientEvents, apiClientEvents } from "./api-client-events.js";
@@ -2,8 +2,8 @@ import { cn } from "../../../lib/utils.js";
2
2
  import { Button } from "../../../components/ui/button.js";
3
3
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../../../components/ui/dropdown-menu.js";
4
4
  import { ScrollArea, ScrollBar } from "../../../components/ui/scroll-area.js";
5
- import { getFileIcon } from "../utils/fileIcons.js";
6
5
  import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger } from "../../../components/ui/context-menu.js";
6
+ import { getFileIcon } from "../utils/fileIcons.js";
7
7
  import { c } from "react/compiler-runtime";
8
8
  import { useEffect, useRef } from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,4 +1 @@
1
- import "./providers/CodeExplorerProvider.js";
2
- import "./CodeExplorer.js";
3
1
  import { FileContentViewer } from "./components/FileContentViewer.js";
4
- import "./components/FileTabsBar.js";
@@ -1,5 +1,5 @@
1
- import { useStudio } from "../../providers/StudioProvider.js";
2
1
  import { useFilterWorkspaces } from "../../hooks/useWorkspaces.js";
2
+ import { useStudio } from "../../providers/StudioProvider.js";
3
3
  import { useComponentOverrides } from "../../providers/ComponentOverridesProvider.js";
4
4
  import { Button } from "../../components/ui/button.js";
5
5
  import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../../components/ui/card.js";
@@ -1,4 +1,5 @@
1
- import { useWorkflow } from "../../../hooks/useWorkflows.js";
1
+ import { useWorkflow } from "../../../packages/react/dist/hooks/queries.js";
2
+ import "../../../hooks/useWorkflows.js";
2
3
  import { Background, BackgroundVariant, Controls, Panel, index, useEdgesState, useNodesState, useReactFlow } from "../../../node_modules/@xyflow/react/dist/esm/index.js";
3
4
  /* empty css */
4
5
  import StateNode_default from "./workflow-flow/StateNode.js";
@@ -1,4 +1,5 @@
1
- import { useWorkflow, useWorkflowCheckpoints } from "../../../../hooks/useWorkflows.js";
1
+ import { useWorkflow, useWorkflowCheckpoints } from "../../../../packages/react/dist/hooks/queries.js";
2
+ import "../../../../hooks/useWorkflows.js";
2
3
  import { buildWorkflowGraph, getTransitions } from "../../lib/flow-utils.js";
3
4
  import { c } from "react/compiler-runtime";
4
5
  import React, { useEffect, useRef } from "react";
@@ -1,6 +1,6 @@
1
- import { useDocumentConfigs } from "../../../hooks/useConfig.js";
2
1
  import { WorkflowState } from "../../../packages/contracts/dist/enums/workflow-state.enum.js";
3
2
  import "../../../packages/contracts/dist/enums/index.js";
3
+ import { useDocumentConfigs } from "../../../hooks/useConfig.js";
4
4
  import DocumentItem_default from "./DocumentItem.js";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import React, { useEffect } from "react";
@@ -257,11 +257,6 @@ var formatDate = (e) => {
257
257
  className: "text-xs capitalize",
258
258
  children: a.level
259
259
  }),
260
- a?.hidden && /* @__PURE__ */ jsx(Badge, {
261
- variant: "outline",
262
- className: "text-xs",
263
- children: "Hidden"
264
- }),
265
260
  m.invalidate && /* @__PURE__ */ jsx(Badge, {
266
261
  variant: "outline",
267
262
  className: "text-xs",
@@ -1,13 +1,14 @@
1
+ import { useRunWorkflow } from "../../../packages/react/dist/hooks/mutations.js";
1
2
  import { useDocumentConfigs } from "../../../hooks/useConfig.js";
2
3
  import { Button } from "../../../components/ui/button.js";
3
- import { useRunWorkflow } from "../../../hooks/useProcessor.js";
4
+ import "../../../hooks/useProcessor.js";
4
5
  import Form_default from "../../../components/dynamic-form/Form.js";
5
6
  import { c } from "react/compiler-runtime";
6
7
  import React, { useEffect } from "react";
7
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { z } from "zod";
8
10
  import { Loader2 } from "lucide-react";
9
11
  import { useForm } from "react-hook-form";
10
- import "zod";
11
12
  function resolveFormConfig(e) {
12
13
  let d = e, f = (d?.widgets)?.find((e) => e.widget === "form");
13
14
  if (f?.options) {
@@ -55,7 +56,7 @@ var DocumentFormRenderer_default = (m) => {
55
56
  }
56
57
  x.mutate({
57
58
  workflowId: g.id,
58
- runWorkflowPayloadDto: { transition: {
59
+ payload: { transition: {
59
60
  id: e,
60
61
  workflowId: _.id,
61
62
  payload: d
@@ -65,9 +66,9 @@ var DocumentFormRenderer_default = (m) => {
65
66
  C?.type === "object" ? A(e, d) : A(e, d.raw);
66
67
  }, M = (e) => {
67
68
  e.transition && E.handleSubmit((d) => j(e.transition)(d), _temp2)();
68
- }, { formUi: N, actions: P } = resolveFormConfig(S?.ui), F = !!N?.form?.disabled, I = !y || F || !1, L = Form_default, R = C ?? {}, z = N ?? void 0, B = S?.meta?.mimeType, V = !b && P.length > 0 ? /* @__PURE__ */ jsx("div", {
69
+ }, { formUi: N, actions: P } = resolveFormConfig(S?.ui), F = !!N?.form?.disabled, I = !y || F || !1, L = Form_default, R = C ?? {}, B = N ?? void 0, V = S?.meta?.mimeType, H = !b && P.length > 0 ? /* @__PURE__ */ jsx("div", {
69
70
  className: "flex w-full flex-col items-end gap-4",
70
- children: P.map((e, f) => {
71
+ children: P.map((e, d) => {
71
72
  let p = I || e.transition !== void 0 && !k.includes(e.transition);
72
73
  return /* @__PURE__ */ jsxs(Button, {
73
74
  type: "button",
@@ -77,21 +78,21 @@ var DocumentFormRenderer_default = (m) => {
77
78
  className: e.type === "button-full-w" ? "w-full" : "w-48",
78
79
  ...e.props ?? {},
79
80
  children: [x.isPending && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), e.label ?? "Submit"]
80
- }, f);
81
+ }, d);
81
82
  })
82
- }) : void 0, H;
83
- return h[6] !== L || h[7] !== I || h[8] !== E || h[9] !== R || h[10] !== z || h[11] !== B || h[12] !== V || h[13] !== b ? (H = /* @__PURE__ */ jsx("div", {
83
+ }) : void 0, U;
84
+ return h[6] !== L || h[7] !== I || h[8] !== E || h[9] !== R || h[10] !== B || h[11] !== V || h[12] !== H || h[13] !== b ? (U = /* @__PURE__ */ jsx("div", {
84
85
  className: "flex",
85
86
  children: /* @__PURE__ */ jsx(L, {
86
87
  form: E,
87
88
  schema: R,
88
- ui: z,
89
- mimeType: B,
89
+ ui: B,
90
+ mimeType: V,
90
91
  disabled: I,
91
92
  viewOnly: b,
92
- actions: V
93
+ actions: H
93
94
  })
94
- }), h[6] = L, h[7] = I, h[8] = E, h[9] = R, h[10] = z, h[11] = B, h[12] = V, h[13] = b, h[14] = H) : H = h[14], H;
95
+ }), h[6] = L, h[7] = I, h[8] = E, h[9] = R, h[10] = B, h[11] = V, h[12] = H, h[13] = b, h[14] = U) : U = h[14], U;
95
96
  };
96
97
  function _temp(e) {
97
98
  return e.id;
@@ -1,6 +1,7 @@
1
- import { useWorkflowStatus } from "../../../hooks/useWorkflows.js";
1
+ import { useWorkflowStatus } from "../../../packages/react/dist/hooks/queries.js";
2
2
  import { WorkflowState } from "../../../packages/contracts/dist/enums/workflow-state.enum.js";
3
3
  import "../../../packages/contracts/dist/enums/index.js";
4
+ import "../../../hooks/useWorkflows.js";
4
5
  import link_default from "../../../components/loopstack-elements/link.js";
5
6
  import { c } from "react/compiler-runtime";
6
7
  import React from "react";
@@ -1,4 +1,5 @@
1
- import { useRunWorkflow } from "../../../hooks/useProcessor.js";
1
+ import { useRunWorkflow } from "../../../packages/react/dist/hooks/mutations.js";
2
+ import "../../../hooks/useProcessor.js";
2
3
  import { c } from "react/compiler-runtime";
3
4
  import { useCallback } from "react";
4
5
  function resolveTransition(e) {
@@ -15,7 +16,7 @@ function useDocumentTransition(i, a, o) {
15
16
  s[4] !== f || s[5] !== i.id || s[6] !== l || s[7] !== d || s[8] !== a.id ? (p = (e) => {
16
17
  !d || !f || l.mutate({
17
18
  workflowId: i.id,
18
- runWorkflowPayloadDto: { transition: {
19
+ payload: { transition: {
19
20
  id: d,
20
21
  workflowId: a.id,
21
22
  payload: e
@@ -1,4 +1,5 @@
1
- import { useAppsConfig } from "../../hooks/useConfig.js";
1
+ import { useAppsConfig } from "../../packages/react/dist/hooks/queries.js";
2
+ import "../../hooks/useConfig.js";
2
3
  import { AVAILABLE_FEATURES } from "./available-features.js";
3
4
  import { c } from "react/compiler-runtime";
4
5
  import { createContext, useContext, useMemo } from "react";
@@ -1,5 +1,5 @@
1
- import { FileTabsBarBase } from "../../code-explorer/components/FileTabsBarBase.js";
2
1
  import { useFileExplorer } from "../providers/FileExplorerProvider.js";
2
+ import { FileTabsBarBase } from "../../code-explorer/components/FileTabsBarBase.js";
3
3
  import { c } from "react/compiler-runtime";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  function FileTabsBar() {
@@ -1,7 +1,7 @@
1
1
  import { Button } from "../../../components/ui/button.js";
2
2
  import { ScrollArea } from "../../../components/ui/scroll-area.js";
3
- import { CodeExplorerTreeNode } from "../../code-explorer/components/CodeExplorerTreeNode.js";
4
3
  import { useFileExplorer } from "../providers/FileExplorerProvider.js";
4
+ import { CodeExplorerTreeNode } from "../../code-explorer/components/CodeExplorerTreeNode.js";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { AlertCircle, Loader2, RefreshCw } from "lucide-react";
@@ -1,46 +1,51 @@
1
- import { useApiClient } from "../../../hooks/useApi.js";
1
+ import { useLoopstackClient } from "../../../packages/react/dist/provider.js";
2
+ import "../../../packages/react/dist/index.js";
2
3
  import { c } from "react/compiler-runtime";
3
4
  import { useQuery } from "@tanstack/react-query";
4
- function useFileTree(r, i, a) {
5
- let o = c(12), s = a === void 0 ? !0 : a, { envKey: l, api: u } = useApiClient(), d;
6
- o[0] !== l || o[1] !== r || o[2] !== i ? (d = [
5
+ var VARIANT_BASE_PATH = {
6
+ local: "local-files",
7
+ remote: "remote-files"
8
+ }, explorerPath = (e, n) => `/api/v1/workspaces/${n}/${VARIANT_BASE_PATH[e]}`;
9
+ function fileTreeKey(e, n, r) {
10
+ return [
7
11
  "file-explorer-tree",
8
- r,
9
- l,
10
- i
11
- ], o[0] = l, o[1] = r, o[2] = i, o[3] = d) : d = o[3];
12
- let f;
13
- o[4] !== u || o[5] !== r || o[6] !== i ? (f = () => u.files[r].getTree({ workspaceId: i }), o[4] = u, o[5] = r, o[6] = i, o[7] = f) : f = o[7];
14
- let p = !!i && s, m;
15
- return o[8] !== d || o[9] !== f || o[10] !== p ? (m = {
16
- queryKey: d,
17
- queryFn: f,
18
- enabled: p,
12
+ e,
13
+ ...n ? [n] : [],
14
+ ...r ? [r] : []
15
+ ];
16
+ }
17
+ function useFileTree(i, o, s) {
18
+ let l = c(12), u = s === void 0 ? !0 : s, d = useLoopstackClient(), f;
19
+ l[0] !== d.envKey || l[1] !== i || l[2] !== o ? (f = fileTreeKey(d.envKey, i, o), l[0] = d.envKey, l[1] = i, l[2] = o, l[3] = f) : f = l[3];
20
+ let p;
21
+ l[4] !== d.http || l[5] !== i || l[6] !== o ? (p = () => d.http.get(`${explorerPath(i, o)}/tree`), l[4] = d.http, l[5] = i, l[6] = o, l[7] = p) : p = l[7];
22
+ let m = !!o && u, h;
23
+ return l[8] !== f || l[9] !== p || l[10] !== m ? (h = {
24
+ queryKey: f,
25
+ queryFn: p,
26
+ enabled: m,
19
27
  staleTime: 3e4,
20
28
  retry: !1
21
- }, o[8] = d, o[9] = f, o[10] = p, o[11] = m) : m = o[11], useQuery(m);
29
+ }, l[8] = f, l[9] = p, l[10] = m, l[11] = h) : h = l[11], useQuery(h);
22
30
  }
23
- function useFileContent(r, i, a, o) {
24
- let s = c(14), l = o === void 0 ? !0 : o, { envKey: u, api: d } = useApiClient(), f;
25
- s[0] !== u || s[1] !== a || s[2] !== r || s[3] !== i ? (f = [
31
+ function useFileContent(i, a, o, s) {
32
+ let l = c(14), u = s === void 0 ? !0 : s, d = useLoopstackClient(), f;
33
+ l[0] !== d.envKey || l[1] !== o || l[2] !== i || l[3] !== a ? (f = [
26
34
  "file-explorer-content",
27
- r,
28
- u,
35
+ d.envKey,
29
36
  i,
30
- a
31
- ], s[0] = u, s[1] = a, s[2] = r, s[3] = i, s[4] = f) : f = s[4];
37
+ a,
38
+ o
39
+ ], l[0] = d.envKey, l[1] = o, l[2] = i, l[3] = a, l[4] = f) : f = l[4];
32
40
  let p;
33
- s[5] !== d || s[6] !== a || s[7] !== r || s[8] !== i ? (p = () => d.files[r].readFile({
34
- workspaceId: i,
35
- path: a
36
- }), s[5] = d, s[6] = a, s[7] = r, s[8] = i, s[9] = p) : p = s[9];
37
- let m = !!i && !!a && l, h;
38
- return s[10] !== f || s[11] !== p || s[12] !== m ? (h = {
41
+ l[5] !== d.http || l[6] !== o || l[7] !== i || l[8] !== a ? (p = () => d.http.get(`${explorerPath(i, a)}/read`, { path: o }), l[5] = d.http, l[6] = o, l[7] = i, l[8] = a, l[9] = p) : p = l[9];
42
+ let m = !!a && !!o && u, h;
43
+ return l[10] !== f || l[11] !== p || l[12] !== m ? (h = {
39
44
  queryKey: f,
40
45
  queryFn: p,
41
46
  enabled: m,
42
47
  staleTime: 15e3,
43
48
  retry: !1
44
- }, s[10] = f, s[11] = p, s[12] = m, s[13] = h) : h = s[13], useQuery(h);
49
+ }, l[10] = f, l[11] = p, l[12] = m, l[13] = h) : h = l[13], useQuery(h);
45
50
  }
46
- export { useFileContent, useFileTree };
51
+ export { fileTreeKey, useFileContent, useFileTree };