@loopstack/loopstack-studio 0.33.0 → 0.35.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 (146) hide show
  1. package/dist/app/EnvironmentEmbedRoot.js +17 -25
  2. package/dist/components/layout/StudioSidebar.js +34 -34
  3. package/dist/components/messages/CompletionMessagePaper.js +25 -29
  4. package/dist/events/api-client-events.js +13 -1
  5. package/dist/events/index.js +1 -0
  6. package/dist/features/code-explorer/components/FileTabsBarBase.js +1 -1
  7. package/dist/features/code-explorer/index.js +0 -3
  8. package/dist/features/dashboard/AppLauncher.js +111 -64
  9. package/dist/features/debug/components/WorkflowFlowViewer.js +2 -1
  10. package/dist/features/debug/components/workflow-flow/WorkflowGraph.js +2 -1
  11. package/dist/features/documents/DocumentRenderer.js +42 -42
  12. package/dist/features/documents/components/DocumentList.js +1 -1
  13. package/dist/features/documents/document-details/DocumentDetails.js +0 -5
  14. package/dist/features/documents/renderers/DocumentFormRenderer.js +13 -12
  15. package/dist/features/documents/renderers/LinkMessageRenderer.js +2 -1
  16. package/dist/features/documents/renderers/useDocumentTransition.js +3 -2
  17. package/dist/features/feature-registry/FeatureRegistryProvider.js +17 -18
  18. package/dist/features/feature-registry/available-features.js +3 -2
  19. package/dist/features/feature-registry/index.js +1 -1
  20. package/dist/features/file-explorer/components/FileExplorerPanel.js +64 -43
  21. package/dist/features/file-explorer/components/FileTabsBar.js +1 -1
  22. package/dist/features/file-explorer/components/FileTree.js +1 -1
  23. package/dist/features/file-explorer/file-explorer-feature.js +15 -7
  24. package/dist/features/file-explorer/hooks/useFileExplorer.js +41 -34
  25. package/dist/features/file-explorer/index.js +1 -1
  26. package/dist/features/file-explorer/providers/FileExplorerProvider.js +91 -89
  27. package/dist/features/git/components/WorkbenchGitPanel.js +7 -10
  28. package/dist/features/git/hooks/useGit.js +55 -57
  29. package/dist/features/health/LocalHealthCheck.js +46 -47
  30. package/dist/features/oauth/OAuthPromptRenderer.js +6 -5
  31. package/dist/features/runs/Runs.js +3 -2
  32. package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
  33. package/dist/features/secrets/renderers/SecretInputRenderer.js +3 -2
  34. package/dist/features/workbench/Workbench.js +16 -16
  35. package/dist/features/workbench/WorkflowItem.js +5 -8
  36. package/dist/features/workbench/components/NewRunDialog.js +173 -171
  37. package/dist/features/workbench/components/PreviewEmptyState.js +1 -1
  38. package/dist/features/workbench/components/WorkbenchIconSidebar.js +1 -1
  39. package/dist/features/workbench/components/WorkbenchRunsPanel.js +2 -1
  40. package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
  41. package/dist/features/workbench/components/WorkflowForms.js +1 -1
  42. package/dist/features/workbench/components/WorkflowHistoryItem.js +2 -1
  43. package/dist/features/workbench/components/buttons/WorkflowButtons.js +8 -14
  44. package/dist/features/workbench/hooks/useLlmStreamingDocuments.js +65 -132
  45. package/dist/features/workbench/hooks/useWorkflowData.js +8 -6
  46. package/dist/features/workbench/index.js +1 -1
  47. package/dist/features/workspaces/Workspaces.js +5 -3
  48. package/dist/features/workspaces/components/CreateWorkspace.js +7 -5
  49. package/dist/features/workspaces/components/ExecutionTimeline.js +69 -65
  50. package/dist/features/workspaces/components/WorkflowRunForm.js +6 -4
  51. package/dist/features/workspaces/components/WorkspaceHomePage.js +1 -1
  52. package/dist/hooks/index.js +5 -5
  53. package/dist/hooks/useAuth.js +14 -53
  54. package/dist/hooks/useConfig.js +13 -37
  55. package/dist/hooks/useDocuments.js +5 -30
  56. package/dist/hooks/useEnvironments.js +34 -24
  57. package/dist/hooks/useProcessor.js +2 -31
  58. package/dist/hooks/useSecrets.js +71 -53
  59. package/dist/hooks/useWorkflows.js +43 -172
  60. package/dist/hooks/useWorkspaces.js +24 -130
  61. package/dist/index.d.ts +137 -481
  62. package/dist/index.js +15 -17
  63. package/dist/loopstack-studio.css +1 -1
  64. package/dist/packages/client/dist/client.js +35 -0
  65. package/dist/packages/client/dist/http.js +47 -0
  66. package/dist/packages/client/dist/index.js +15 -0
  67. package/dist/packages/client/dist/queries/query-keys.js +94 -0
  68. package/dist/packages/client/dist/queries/query-options.js +97 -0
  69. package/dist/packages/client/dist/resources/auth.js +10 -0
  70. package/dist/packages/client/dist/resources/config.js +11 -0
  71. package/dist/packages/client/dist/resources/dashboard.js +4 -0
  72. package/dist/packages/client/dist/resources/documents.js +7 -0
  73. package/dist/packages/client/dist/resources/processor.js +7 -0
  74. package/dist/packages/client/dist/resources/workflows.js +13 -0
  75. package/dist/packages/client/dist/resources/workspaces.js +12 -0
  76. package/dist/packages/client/dist/stream/invalidations.js +20 -0
  77. package/dist/packages/client/dist/stream/llm-reducer.js +65 -0
  78. package/dist/packages/client/dist/stream/sse-parser.js +40 -0
  79. package/dist/packages/client/dist/stream/stream.js +147 -0
  80. package/dist/packages/contracts/dist/events/client-message-base.schema.js +6 -0
  81. package/dist/packages/contracts/dist/events/client-message.schema.js +24 -0
  82. package/dist/packages/contracts/dist/events/index.js +6 -0
  83. package/dist/packages/contracts/dist/events/llm-events.schema.js +44 -0
  84. package/dist/packages/contracts/dist/events/stream-events.schema.js +4 -0
  85. package/dist/packages/contracts/dist/events/workflow-events.schema.js +20 -0
  86. package/dist/packages/contracts/dist/events/workspace-events.schema.js +5 -0
  87. package/dist/packages/contracts/dist/types/types/ui-message.type.js +39 -0
  88. package/dist/packages/react/dist/hooks/mutations.js +175 -0
  89. package/dist/packages/react/dist/hooks/queries.js +139 -0
  90. package/dist/packages/react/dist/hooks/use-live-invalidation.js +39 -0
  91. package/dist/packages/react/dist/hooks/use-llm-stream.js +18 -0
  92. package/dist/packages/react/dist/index.js +5 -0
  93. package/dist/packages/react/dist/provider.js +15 -0
  94. package/dist/pages/DashboardPage.js +2 -1
  95. package/dist/pages/DebugWorkflowDetailsPage.js +2 -1
  96. package/dist/pages/DebugWorkflowsPage.js +2 -1
  97. package/dist/pages/EmbedWorkbenchPage.js +50 -43
  98. package/dist/pages/PreviewWorkbenchPage.js +60 -59
  99. package/dist/pages/StudioLandingPage.js +1 -1
  100. package/dist/pages/WorkbenchPage.js +53 -47
  101. package/dist/pages/WorkflowDebugPage.js +3 -2
  102. package/dist/pages/WorkspacePage.js +42 -27
  103. package/dist/pages/WorkspaceRunsPage.js +36 -27
  104. package/dist/providers/LoopstackClientProvider.js +31 -0
  105. package/dist/services/createApiClient.js +9 -3
  106. package/dist/services/index.js +0 -1
  107. package/dist/services/reporting-fetch.js +13 -0
  108. package/package.json +4 -3
  109. package/dist/api/auth.js +0 -10
  110. package/dist/api/client.js +0 -13
  111. package/dist/api/config.js +0 -11
  112. package/dist/api/dashboard.js +0 -4
  113. package/dist/api/documents.js +0 -7
  114. package/dist/api/environments.js +0 -8
  115. package/dist/api/index.js +0 -28
  116. package/dist/api/processor.js +0 -7
  117. package/dist/api/secrets.js +0 -16
  118. package/dist/api/workflows.js +0 -15
  119. package/dist/api/workspaces.js +0 -12
  120. package/dist/events/sse-client-events.js +0 -13
  121. package/dist/features/code-explorer/CodeExplorer.js +0 -6
  122. package/dist/features/code-explorer/components/CodeExplorerTree.js +0 -6
  123. package/dist/features/code-explorer/components/FileTabsBar.js +0 -4
  124. package/dist/features/code-explorer/providers/CodeExplorerProvider.js +0 -5
  125. package/dist/features/file-explorer/api/files.js +0 -7
  126. package/dist/features/git/api/git.js +0 -9
  127. package/dist/hooks/query-keys.js +0 -145
  128. package/dist/hooks/useApi.js +0 -15
  129. package/dist/hooks/useFiles.js +0 -3
  130. package/dist/node_modules/lodash/_Symbol.js +0 -7
  131. package/dist/node_modules/lodash/_baseGetTag.js +0 -13
  132. package/dist/node_modules/lodash/_baseTrim.js +0 -11
  133. package/dist/node_modules/lodash/_freeGlobal.js +0 -6
  134. package/dist/node_modules/lodash/_getRawTag.js +0 -17
  135. package/dist/node_modules/lodash/_objectToString.js +0 -10
  136. package/dist/node_modules/lodash/_root.js +0 -8
  137. package/dist/node_modules/lodash/_trimmedEndIndex.js +0 -11
  138. package/dist/node_modules/lodash/debounce.js +0 -53
  139. package/dist/node_modules/lodash/isObject.js +0 -10
  140. package/dist/node_modules/lodash/isObjectLike.js +0 -9
  141. package/dist/node_modules/lodash/isSymbol.js +0 -12
  142. package/dist/node_modules/lodash/now.js +0 -10
  143. package/dist/node_modules/lodash/toNumber.js +0 -22
  144. package/dist/providers/InvalidationEventsProvider.js +0 -41
  145. package/dist/providers/SseProvider.js +0 -37
  146. package/dist/services/eventEmitter.js +0 -12
@@ -1,37 +1,29 @@
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
- import { FeatureRegistryProvider } from "../features/feature-registry/FeatureRegistryProvider.js";
6
- import "../features/feature-registry/index.js";
7
4
  import LocalHealthCheck_default from "../features/health/LocalHealthCheck.js";
8
5
  import { QueryProvider } from "../providers/QueryProvider.js";
9
6
  import { c } from "react/compiler-runtime";
10
7
  import { jsx, jsxs } from "react/jsx-runtime";
11
8
  import { Outlet, useSearchParams } from "react-router-dom";
12
9
  function EnvironmentEmbedRoot() {
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);
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);
15
14
  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 = {
15
+ d[4] !== g || d[5] !== m ? (_ = {
19
16
  id: "preview-env",
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;
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;
36
28
  }
37
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);
@@ -4,7 +4,7 @@ import { c } from "react/compiler-runtime";
4
4
  import React from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  var CompletionMessagePaper_default = (s) => {
7
- let l = c(38), { role: u, children: d, timestamp: f, metadata: p, fullWidth: m, className: h } = s, g = m === void 0 ? !1 : m, _;
7
+ let l = c(33), { role: u, children: d, timestamp: f, metadata: p, fullWidth: m, className: h } = s, g = m === void 0 ? !1 : m, _;
8
8
  l[0] === Symbol.for("react.memo_cache_sentinel") ? (_ = {
9
9
  system: {
10
10
  color: "#efb108",
@@ -58,46 +58,42 @@ var CompletionMessagePaper_default = (s) => {
58
58
  }), l[15] = b, l[16] = p, l[17] = A) : A = l[17];
59
59
  let j = g ? "w-full" : "w-auto", M;
60
60
  l[18] === j ? M = l[19] : (M = cn("relative max-w-full px-6 py-4 wrap-break-word shadow-none", j), l[18] = j, l[19] = M);
61
- let N = b ? "user" : "text-foreground", P;
62
- l[20] === N ? P = l[21] : (P = cn("leading-relaxed wrap-break-word whitespace-pre-wrap", N), l[20] = N, l[21] = P);
63
- let F;
64
- l[22] === d ? F = l[23] : (F = /* @__PURE__ */ jsx("div", {
65
- className: "message-content",
66
- children: d
67
- }), l[22] = d, l[23] = F);
68
- let I;
69
- l[24] !== P || l[25] !== F ? (I = /* @__PURE__ */ jsx("div", {
70
- className: P,
71
- children: F
72
- }), l[24] = P, l[25] = F, l[26] = I) : I = l[26];
73
- let L;
74
- l[27] !== M || l[28] !== I ? (L = /* @__PURE__ */ jsx(Card, {
61
+ let N;
62
+ l[20] === d ? N = l[21] : (N = /* @__PURE__ */ jsx("div", {
63
+ className: "text-foreground leading-relaxed wrap-break-word whitespace-pre-wrap",
64
+ children: /* @__PURE__ */ jsx("div", {
65
+ className: "message-content",
66
+ children: d
67
+ })
68
+ }), l[20] = d, l[21] = N);
69
+ let P;
70
+ l[22] !== M || l[23] !== N ? (P = /* @__PURE__ */ jsx(Card, {
75
71
  className: M,
76
- children: I
77
- }), l[27] = M, l[28] = I, l[29] = L) : L = l[29];
78
- let R;
79
- l[30] !== k || l[31] !== A || l[32] !== L || l[33] !== E ? (R = /* @__PURE__ */ jsxs("div", {
72
+ children: N
73
+ }), l[22] = M, l[23] = N, l[24] = P) : P = l[24];
74
+ let F;
75
+ l[25] !== k || l[26] !== A || l[27] !== P || l[28] !== E ? (F = /* @__PURE__ */ jsxs("div", {
80
76
  className: E,
81
77
  children: [
82
78
  k,
83
79
  A,
84
- L
80
+ P
85
81
  ]
86
- }), l[30] = k, l[31] = A, l[32] = L, l[33] = E, l[34] = R) : R = l[34];
87
- let z;
88
- return l[35] !== R || l[36] !== C ? (z = /* @__PURE__ */ jsx("div", {
82
+ }), l[25] = k, l[26] = A, l[27] = P, l[28] = E, l[29] = F) : F = l[29];
83
+ let I;
84
+ return l[30] !== F || l[31] !== C ? (I = /* @__PURE__ */ jsx("div", {
89
85
  className: C,
90
- children: R
91
- }), l[35] = R, l[36] = C, l[37] = z) : z = l[37], z;
86
+ children: F
87
+ }), l[30] = F, l[31] = C, l[32] = I) : I = l[32], I;
92
88
  };
93
- function _temp(r) {
94
- return r.toLocaleTimeString([], {
89
+ function _temp(t) {
90
+ return t.toLocaleTimeString([], {
95
91
  hour: "2-digit",
96
92
  minute: "2-digit"
97
93
  });
98
94
  }
99
- function _temp2(r) {
100
- let [a, o] = r;
95
+ function _temp2(t) {
96
+ let [a, o] = t;
101
97
  return /* @__PURE__ */ jsxs("div", {
102
98
  className: "text-muted-foreground font-mono text-xs",
103
99
  children: [
@@ -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,84 +1,131 @@
1
+ import { useFilterWorkspaces } from "../../hooks/useWorkspaces.js";
1
2
  import { useStudio } from "../../providers/StudioProvider.js";
2
3
  import { useComponentOverrides } from "../../providers/ComponentOverridesProvider.js";
3
4
  import { Button } from "../../components/ui/button.js";
4
5
  import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../../components/ui/card.js";
5
6
  import { Dialog, DialogContent } from "../../components/ui/dialog.js";
6
7
  import CreateWorkspace_default from "../workspaces/components/CreateWorkspace.js";
8
+ import { AVAILABLE_FEATURES } from "../feature-registry/available-features.js";
7
9
  import { c } from "react/compiler-runtime";
8
10
  import { useMemo, useState } from "react";
9
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
12
  import { Link } from "react-router-dom";
11
- import { Boxes, FolderOpen, Plus } from "lucide-react";
12
- function AppLauncher(x) {
13
- let S = c(25), { apps: C } = x, { CreateWorkspace: w } = useComponentOverrides(), T = w ?? CreateWorkspace_default, { router: E } = useStudio(), [D, O] = useState(null), k;
14
- S[0] === D ? k = S[1] : (k = D ? [{
15
- appName: D.appName,
16
- title: D.title,
17
- environments: D.extensions?.environments ?? []
18
- }] : [], S[0] = D, S[1] = k);
19
- let A = k, j;
20
- S[2] === E ? j = S[3] : (j = (e) => {
21
- O(null), e && E.navigateToWorkspace(e.id);
22
- }, S[2] = E, S[3] = j);
23
- let M = j, N;
24
- if (S[4] !== C || S[5] !== E) {
13
+ import { Boxes, FolderOpen, Plus, Server } from "lucide-react";
14
+ function getCapabilityIcons(e) {
15
+ let S = [];
16
+ for (let C of e.extensions?.environments ?? []) S.push({
17
+ key: `env:${C.id}`,
18
+ Icon: Server,
19
+ label: C.title ?? C.id
20
+ });
21
+ for (let C of e.features) {
22
+ if (C.enabled === !1) continue;
23
+ let e = AVAILABLE_FEATURES[C.id];
24
+ e?.sidebarPanel && S.push({
25
+ key: `feature:${e.id}`,
26
+ Icon: e.sidebarPanel.icon,
27
+ label: e.sidebarPanel.label
28
+ });
29
+ }
30
+ return S;
31
+ }
32
+ function AppLauncher(w) {
33
+ let T = c(30), { apps: E } = w, { CreateWorkspace: D } = useComponentOverrides(), O = D ?? CreateWorkspace_default, { router: k } = useStudio(), [A, j] = useState(null), M;
34
+ T[0] === Symbol.for("react.memo_cache_sentinel") ? (M = {}, T[0] = M) : M = T[0];
35
+ let N = useFilterWorkspaces(void 0, M, "id", "DESC", 0, 1e3), P;
36
+ if (T[1] !== N.data?.data) {
37
+ P = {};
38
+ for (let e of N.data?.data ?? []) P[e.appName] = (P[e.appName] ?? 0) + 1;
39
+ T[1] = N.data?.data, T[2] = P;
40
+ } else P = T[2];
41
+ let F = P, I;
42
+ T[3] === A ? I = T[4] : (I = A ? [{
43
+ appName: A.appName,
44
+ title: A.title,
45
+ environments: A.extensions?.environments ?? []
46
+ }] : [], T[3] = A, T[4] = I);
47
+ let L = I, R;
48
+ T[5] === k ? R = T[6] : (R = (e) => {
49
+ j(null), e && k.navigateToWorkspace(e.id);
50
+ }, T[5] = k, T[6] = R);
51
+ let z = R, B;
52
+ if (T[7] !== E || T[8] !== k || T[9] !== F) {
25
53
  let e;
26
- S[7] === E ? e = S[8] : (e = (e) => /* @__PURE__ */ jsxs(Card, {
27
- className: "flex flex-col",
28
- children: [/* @__PURE__ */ jsxs(CardHeader, { children: [/* @__PURE__ */ jsxs("div", {
29
- className: "flex items-center gap-2",
30
- children: [/* @__PURE__ */ jsx(Boxes, { className: "text-muted-foreground h-5 w-5" }), /* @__PURE__ */ jsx(CardTitle, {
31
- className: "text-base",
32
- children: e.title
33
- })]
34
- }), e.description && /* @__PURE__ */ jsx(CardDescription, { children: e.description })] }), /* @__PURE__ */ jsxs(CardContent, {
35
- className: "mt-auto flex gap-2",
36
- children: [/* @__PURE__ */ jsx(Button, {
37
- variant: "ghost",
38
- size: "sm",
39
- className: "flex-1",
40
- asChild: !0,
41
- children: /* @__PURE__ */ jsxs(Link, {
42
- to: `${E.getWorkspaces()}?appName=${encodeURIComponent(e.appName)}`,
43
- children: [/* @__PURE__ */ jsx(FolderOpen, { className: "mr-1 h-4 w-4" }), "View Workspaces"]
54
+ T[11] !== k || T[12] !== F ? (e = (e) => {
55
+ let S = getCapabilityIcons(e), C = F[e.appName] ?? 0;
56
+ return /* @__PURE__ */ jsxs(Card, {
57
+ className: "flex flex-col",
58
+ children: [/* @__PURE__ */ jsxs(CardHeader, { children: [/* @__PURE__ */ jsxs("div", {
59
+ className: "flex items-start justify-between gap-2",
60
+ children: [/* @__PURE__ */ jsxs("div", {
61
+ className: "flex items-center gap-2",
62
+ children: [/* @__PURE__ */ jsx(Boxes, { className: "text-muted-foreground h-5 w-5" }), /* @__PURE__ */ jsx(CardTitle, {
63
+ className: "text-base",
64
+ children: e.title
65
+ })]
66
+ }), S.length > 0 && /* @__PURE__ */ jsx("div", {
67
+ className: "text-muted-foreground flex shrink-0 items-center gap-1",
68
+ children: S.map(_temp)
69
+ })]
70
+ }), e.description && /* @__PURE__ */ jsx(CardDescription, { children: e.description })] }), /* @__PURE__ */ jsx(CardContent, {
71
+ className: "mt-auto",
72
+ children: /* @__PURE__ */ jsx("div", {
73
+ className: "flex gap-2",
74
+ children: C > 0 ? /* @__PURE__ */ jsx(Button, {
75
+ variant: "ghost",
76
+ size: "sm",
77
+ className: "flex-1",
78
+ asChild: !0,
79
+ children: /* @__PURE__ */ jsxs(Link, {
80
+ to: `${k.getWorkspaces()}?appName=${encodeURIComponent(e.appName)}`,
81
+ children: [/* @__PURE__ */ jsx(FolderOpen, { className: "mr-1 h-4 w-4" }), "View Workspaces"]
82
+ })
83
+ }) : /* @__PURE__ */ jsxs(Button, {
84
+ variant: "outline",
85
+ size: "sm",
86
+ className: "flex-1",
87
+ onClick: () => j(e),
88
+ children: [/* @__PURE__ */ jsx(Plus, { className: "mr-1 h-4 w-4" }), "Configure"]
89
+ })
44
90
  })
45
- }), /* @__PURE__ */ jsxs(Button, {
46
- variant: "outline",
47
- size: "sm",
48
- className: "flex-1",
49
- onClick: () => O(e),
50
- children: [/* @__PURE__ */ jsx(Plus, { className: "mr-1 h-4 w-4" }), "Create Workspace"]
51
91
  })]
52
- })]
53
- }, e.appName), S[7] = E, S[8] = e), N = C.map(e), S[4] = C, S[5] = E, S[6] = N;
54
- } else N = S[6];
55
- let P;
56
- S[9] === N ? P = S[10] : (P = /* @__PURE__ */ jsx("div", {
92
+ }, e.appName);
93
+ }, T[11] = k, T[12] = F, T[13] = e) : e = T[13], B = E.map(e), T[7] = E, T[8] = k, T[9] = F, T[10] = B;
94
+ } else B = T[10];
95
+ let V;
96
+ T[14] === B ? V = T[15] : (V = /* @__PURE__ */ jsx("div", {
57
97
  className: "mb-8",
58
98
  children: /* @__PURE__ */ jsx("div", {
59
99
  className: "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",
60
- children: N
100
+ children: B
61
101
  })
62
- }), S[9] = N, S[10] = P);
63
- let F = !!D, I;
64
- S[11] === Symbol.for("react.memo_cache_sentinel") ? (I = (e) => !e && O(null), S[11] = I) : I = S[11];
65
- let L;
66
- S[12] !== T || S[13] !== A || S[14] !== M || S[15] !== D ? (L = D && /* @__PURE__ */ jsx(T, {
67
- types: A,
68
- onSuccess: M
69
- }), S[12] = T, S[13] = A, S[14] = M, S[15] = D, S[16] = L) : L = S[16];
70
- let R;
71
- S[17] === L ? R = S[18] : (R = /* @__PURE__ */ jsx(DialogContent, {
102
+ }), T[14] = B, T[15] = V);
103
+ let H = !!A, U;
104
+ T[16] === Symbol.for("react.memo_cache_sentinel") ? (U = (e) => !e && j(null), T[16] = U) : U = T[16];
105
+ let W;
106
+ T[17] !== O || T[18] !== L || T[19] !== z || T[20] !== A ? (W = A && /* @__PURE__ */ jsx(O, {
107
+ types: L,
108
+ onSuccess: z
109
+ }), T[17] = O, T[18] = L, T[19] = z, T[20] = A, T[21] = W) : W = T[21];
110
+ let G;
111
+ T[22] === W ? G = T[23] : (G = /* @__PURE__ */ jsx(DialogContent, {
72
112
  className: "max-w-2xl",
73
- children: L
74
- }), S[17] = L, S[18] = R);
75
- let z;
76
- S[19] !== F || S[20] !== R ? (z = /* @__PURE__ */ jsx(Dialog, {
77
- open: F,
78
- onOpenChange: I,
79
- children: R
80
- }), S[19] = F, S[20] = R, S[21] = z) : z = S[21];
81
- let B;
82
- return S[22] !== P || S[23] !== z ? (B = /* @__PURE__ */ jsxs(Fragment$1, { children: [P, z] }), S[22] = P, S[23] = z, S[24] = B) : B = S[24], B;
113
+ children: W
114
+ }), T[22] = W, T[23] = G);
115
+ let K;
116
+ T[24] !== H || T[25] !== G ? (K = /* @__PURE__ */ jsx(Dialog, {
117
+ open: H,
118
+ onOpenChange: U,
119
+ children: G
120
+ }), T[24] = H, T[25] = G, T[26] = K) : K = T[26];
121
+ let q;
122
+ return T[27] !== K || T[28] !== V ? (q = /* @__PURE__ */ jsxs(Fragment$1, { children: [V, K] }), T[27] = K, T[28] = V, T[29] = q) : q = T[29], q;
123
+ }
124
+ function _temp(e) {
125
+ let { key: S, Icon: C } = e;
126
+ return /* @__PURE__ */ jsx("span", {
127
+ className: "inline-flex h-6 w-6 items-center justify-center",
128
+ children: /* @__PURE__ */ jsx(C, { className: "h-4 w-4" })
129
+ }, S);
83
130
  }
84
131
  export { AppLauncher as default };
@@ -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";