@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,8 +1,12 @@
1
- import { useWorkflow } from "../hooks/useWorkflows.js";
2
- import LoadingCentered_default from "../components/feedback/LoadingCentered.js";
3
- import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
1
+ import { useWorkflow, useWorkspace } from "../packages/react/dist/hooks/queries.js";
4
2
  import { WorkflowState } from "../packages/contracts/dist/enums/workflow-state.enum.js";
5
3
  import "../packages/contracts/dist/enums/index.js";
4
+ import "../hooks/useWorkflows.js";
5
+ import "../hooks/useWorkspaces.js";
6
+ import LoadingCentered_default from "../components/feedback/LoadingCentered.js";
7
+ import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
8
+ import { FeatureRegistryProvider } from "../features/feature-registry/FeatureRegistryProvider.js";
9
+ import "../features/feature-registry/index.js";
6
10
  import WorkflowItem_default from "../features/workbench/WorkflowItem.js";
7
11
  import { WorkbenchLayoutProvider } from "../features/workbench/providers/WorkbenchLayoutProvider.js";
8
12
  import "../features/workbench/index.js";
@@ -13,59 +17,62 @@ import { jsx, jsxs } from "react/jsx-runtime";
13
17
  import { useParams } from "react-router-dom";
14
18
  var EMBED_MESSAGE_TYPE = "loopstack:embed:workflow-completed", EMBED_RESIZE_MESSAGE_TYPE = "loopstack:embed:resize";
15
19
  function EmbedWorkbenchPage() {
16
- let _ = c(20), v = useParams(), y;
17
- _[0] === v ? y = _[1] : (y = requireParam(v, "workflowId"), _[0] = v, _[1] = y);
18
- let b = y, x = useRef(null), S = useWorkflow(b), C = useRef(!1), w, T;
19
- _[2] !== S.data || _[3] !== b ? (w = () => {
20
- !S.data || C.current || S.data.status === WorkflowState.Completed && window.parent !== window && (C.current = !0, window.parent.postMessage({
20
+ let y = c(21), b = useParams(), x;
21
+ y[0] === b ? x = y[1] : (x = requireParam(b, "workflowId"), y[0] = b, y[1] = x);
22
+ let S = x, C = useRef(null), w = useWorkflow(S), T = useWorkspace(w.data?.workspaceId), E = useRef(!1), D, O;
23
+ y[2] !== w.data || y[3] !== S ? (D = () => {
24
+ !w.data || E.current || w.data.status === WorkflowState.Completed && window.parent !== window && (E.current = !0, window.parent.postMessage({
21
25
  type: EMBED_MESSAGE_TYPE,
22
- workflowId: b
26
+ workflowId: S
23
27
  }, window.location.origin));
24
- }, T = [S.data, b], _[2] = S.data, _[3] = b, _[4] = w, _[5] = T) : (w = _[4], T = _[5]), useEffect(w, T);
25
- let E, D;
26
- _[6] === b ? (E = _[7], D = _[8]) : (E = () => {
27
- if (window.parent === window || !x.current) return;
28
+ }, O = [w.data, S], y[2] = w.data, y[3] = S, y[4] = D, y[5] = O) : (D = y[4], O = y[5]), useEffect(D, O);
29
+ let k, A;
30
+ y[6] === S ? (k = y[7], A = y[8]) : (k = () => {
31
+ if (window.parent === window || !C.current) return;
28
32
  let t = new ResizeObserver(() => {
29
- if (!x.current) return;
33
+ if (!C.current) return;
30
34
  let t = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight);
31
35
  window.parent.postMessage({
32
36
  type: EMBED_RESIZE_MESSAGE_TYPE,
33
- workflowId: b,
37
+ workflowId: S,
34
38
  height: t
35
39
  }, window.location.origin);
36
40
  });
37
- return t.observe(x.current), () => t.disconnect();
38
- }, D = [b], _[6] = b, _[7] = E, _[8] = D), useEffect(E, D);
39
- let O = _temp, k;
40
- _[9] === Symbol.for("react.memo_cache_sentinel") ? (k = {
41
+ return t.observe(C.current), () => t.disconnect();
42
+ }, A = [S], y[6] = S, y[7] = k, y[8] = A), useEffect(k, A);
43
+ let j = _temp, M;
44
+ y[9] === Symbol.for("react.memo_cache_sentinel") ? (M = {
41
45
  enableDebugMode: !1,
42
46
  showFullMessageHistory: !1
43
- }, _[9] = k) : k = _[9];
44
- let A = k, j;
45
- _[10] === S.error ? j = _[11] : (j = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: S.error }), _[10] = S.error, _[11] = j);
46
- let M;
47
- _[12] === S.data ? M = _[13] : (M = S.data ? /* @__PURE__ */ jsx(WorkbenchLayoutProvider, {
48
- workspaceId: S.data.workspaceId,
49
- workflow: S.data,
50
- children: /* @__PURE__ */ jsx(WorkflowItem_default, {
51
- workflow: S.data,
52
- workflowId: S.data.id,
53
- scrollTo: O,
54
- settings: A,
55
- embed: !0
47
+ }, y[9] = M) : M = y[9];
48
+ let N = M, P;
49
+ y[10] === w.error ? P = y[11] : (P = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: w.error }), y[10] = w.error, y[11] = P);
50
+ let F = w.isLoading || T.isLoading, I;
51
+ y[12] !== w.data || y[13] !== T ? (I = w.data && T.data ? /* @__PURE__ */ jsx(FeatureRegistryProvider, {
52
+ appName: T.data.appName,
53
+ children: /* @__PURE__ */ jsx(WorkbenchLayoutProvider, {
54
+ workspaceId: w.data.workspaceId,
55
+ workflow: w.data,
56
+ children: /* @__PURE__ */ jsx(WorkflowItem_default, {
57
+ workflow: w.data,
58
+ workflowId: w.data.id,
59
+ scrollTo: j,
60
+ settings: N,
61
+ embed: !0
62
+ })
56
63
  })
57
- }) : null, _[12] = S.data, _[13] = M);
58
- let N;
59
- _[14] !== S.isLoading || _[15] !== M ? (N = /* @__PURE__ */ jsx(LoadingCentered_default, {
60
- loading: S.isLoading,
61
- children: M
62
- }), _[14] = S.isLoading, _[15] = M, _[16] = N) : N = _[16];
63
- let P;
64
- return _[17] !== j || _[18] !== N ? (P = /* @__PURE__ */ jsxs("div", {
65
- ref: x,
64
+ }) : null, y[12] = w.data, y[13] = T, y[14] = I) : I = y[14];
65
+ let L;
66
+ y[15] !== F || y[16] !== I ? (L = /* @__PURE__ */ jsx(LoadingCentered_default, {
67
+ loading: F,
68
+ children: I
69
+ }), y[15] = F, y[16] = I, y[17] = L) : L = y[17];
70
+ let R;
71
+ return y[18] !== P || y[19] !== L ? (R = /* @__PURE__ */ jsxs("div", {
72
+ ref: C,
66
73
  className: "overflow-hidden pl-3 py-4",
67
- children: [j, N]
68
- }), _[17] = j, _[18] = N, _[19] = P) : P = _[19], P;
74
+ children: [P, L]
75
+ }), y[18] = P, y[19] = L, y[20] = R) : R = y[20], R;
69
76
  }
70
77
  function _temp() {}
71
78
  export { EmbedWorkbenchPage as default };
@@ -1,13 +1,14 @@
1
+ import { useWorkflow } from "../packages/react/dist/hooks/queries.js";
2
+ import { WorkflowState } from "../packages/contracts/dist/enums/workflow-state.enum.js";
3
+ import "../packages/contracts/dist/enums/index.js";
4
+ import { useFilterWorkflows, useWorkflowConfigByName } from "../hooks/useWorkflows.js";
1
5
  import { useStudio } from "../providers/StudioProvider.js";
2
- import { useFilterWorkflows, useWorkflow, useWorkflowConfigByName } from "../hooks/useWorkflows.js";
3
6
  import { Button } from "../components/ui/button.js";
4
7
  import LoadingCentered_default from "../components/feedback/LoadingCentered.js";
5
8
  import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
6
9
  import { ReactFlowProvider } from "../node_modules/@xyflow/react/dist/esm/index.js";
7
10
  import WorkflowFlowViewer_default from "../features/debug/components/WorkflowFlowViewer.js";
8
11
  import "../features/debug/index.js";
9
- import { WorkflowState } from "../packages/contracts/dist/enums/workflow-state.enum.js";
10
- import "../packages/contracts/dist/enums/index.js";
11
12
  import WorkflowItem_default from "../features/workbench/WorkflowItem.js";
12
13
  import WorkflowHistoryList_default from "../features/workbench/components/WorkflowHistoryList.js";
13
14
  import { NewRunDialog } from "../features/workbench/components/NewRunDialog.js";
@@ -44,16 +45,16 @@ function PreviewWorkbenchPage() {
44
45
  onNewRunSuccess: a
45
46
  }), e[3] = t, e[4] = o), o;
46
47
  }
47
- function PreviewWorkbenchContent(e) {
48
- let t = c(49), { workflowId: m, onNewRunSuccess: h } = e, _ = useRef(null), [y, b] = useState("output"), [x, S] = useState(!1), w = useWorkflow(m), T = useRef(!1), O = useWorkflowConfigByName(w.data?.workflowName), A, j;
49
- t[0] !== w.data || t[1] !== m ? (A = () => {
48
+ function PreviewWorkbenchContent(n) {
49
+ let i = c(49), { workflowId: m, onNewRunSuccess: h } = n, _ = useRef(null), [y, b] = useState("output"), [x, S] = useState(!1), w = useWorkflow(m), T = useRef(!1), O = useWorkflowConfigByName(w.data?.workflowName), A, j;
50
+ i[0] !== w.data || i[1] !== m ? (A = () => {
50
51
  !w.data || T.current || w.data.status === WorkflowState.Completed && window.parent !== window && (T.current = !0, window.parent.postMessage({
51
52
  type: EMBED_MESSAGE_TYPE,
52
53
  workflowId: m
53
54
  }, window.location.origin));
54
- }, j = [w.data, m], t[0] = w.data, t[1] = m, t[2] = A, t[3] = j) : (A = t[2], j = t[3]), useEffect(A, j);
55
+ }, j = [w.data, m], i[0] = w.data, i[1] = m, i[2] = A, i[3] = j) : (A = i[2], j = i[3]), useEffect(A, j);
55
56
  let M, N;
56
- t[4] === m ? (M = t[5], N = t[6]) : (M = () => {
57
+ i[4] === m ? (M = i[5], N = i[6]) : (M = () => {
57
58
  if (window.parent === window || !_.current) return;
58
59
  let e = new ResizeObserver(() => {
59
60
  if (!_.current) return;
@@ -65,36 +66,36 @@ function PreviewWorkbenchContent(e) {
65
66
  }, window.location.origin);
66
67
  });
67
68
  return e.observe(_.current), () => e.disconnect();
68
- }, N = [m], t[4] = m, t[5] = M, t[6] = N), useEffect(M, N);
69
+ }, N = [m], i[4] = m, i[5] = M, i[6] = N), useEffect(M, N);
69
70
  let P;
70
- t[7] === h ? P = t[8] : (P = (e) => {
71
+ i[7] === h ? P = i[8] : (P = (e) => {
71
72
  S(!1), h(e);
72
- }, t[7] = h, t[8] = P);
73
+ }, i[7] = h, i[8] = P);
73
74
  let F = P, I = _temp, L;
74
- t[9] === Symbol.for("react.memo_cache_sentinel") ? (L = {
75
+ i[9] === Symbol.for("react.memo_cache_sentinel") ? (L = {
75
76
  enableDebugMode: !1,
76
77
  showFullMessageHistory: !1
77
- }, t[9] = L) : L = t[9];
78
+ }, i[9] = L) : L = i[9];
78
79
  let R = L, z;
79
- t[10] === Symbol.for("react.memo_cache_sentinel") ? (z = {
80
+ i[10] === Symbol.for("react.memo_cache_sentinel") ? (z = {
80
81
  value: "output",
81
82
  label: "Output",
82
83
  icon: /* @__PURE__ */ jsx(ScrollText, { className: "h-3.5 w-3.5" })
83
- }, t[10] = z) : z = t[10];
84
+ }, i[10] = z) : z = i[10];
84
85
  let B;
85
- t[11] === Symbol.for("react.memo_cache_sentinel") ? (B = {
86
+ i[11] === Symbol.for("react.memo_cache_sentinel") ? (B = {
86
87
  value: "graph",
87
88
  label: "Graph",
88
89
  icon: /* @__PURE__ */ jsx(Workflow, { className: "h-3.5 w-3.5" })
89
- }, t[11] = B) : B = t[11];
90
+ }, i[11] = B) : B = i[11];
90
91
  let V;
91
- t[12] === Symbol.for("react.memo_cache_sentinel") ? (V = {
92
+ i[12] === Symbol.for("react.memo_cache_sentinel") ? (V = {
92
93
  value: "run-log",
93
94
  label: "Run Log",
94
95
  icon: /* @__PURE__ */ jsx(ListOrdered, { className: "h-3.5 w-3.5" })
95
- }, t[12] = V) : V = t[12];
96
+ }, i[12] = V) : V = i[12];
96
97
  let H;
97
- t[13] === Symbol.for("react.memo_cache_sentinel") ? (H = [
98
+ i[13] === Symbol.for("react.memo_cache_sentinel") ? (H = [
98
99
  z,
99
100
  B,
100
101
  V,
@@ -103,33 +104,33 @@ function PreviewWorkbenchContent(e) {
103
104
  label: "Logs",
104
105
  icon: /* @__PURE__ */ jsx(ScrollText, { className: "h-3.5 w-3.5" })
105
106
  }
106
- ], t[13] = H) : H = t[13];
107
+ ], i[13] = H) : H = i[13];
107
108
  let ce = H, U;
108
- t[14] === y ? U = t[15] : (U = /* @__PURE__ */ jsx("div", {
109
+ i[14] === y ? U = i[15] : (U = /* @__PURE__ */ jsx("div", {
109
110
  className: "bg-background flex items-center rounded-md border p-0.5",
110
111
  children: ce.map((e) => /* @__PURE__ */ jsxs("button", {
111
112
  onClick: () => b(e.value),
112
113
  className: `flex items-center gap-1.5 rounded-sm px-2.5 py-1 text-xs font-medium transition-colors ${y === e.value ? "bg-foreground text-background shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
113
114
  children: [e.icon, e.label]
114
115
  }, e.value))
115
- }), t[14] = y, t[15] = U);
116
+ }), i[14] = y, i[15] = U);
116
117
  let W;
117
- t[16] === Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ jsxs(Button, {
118
+ i[16] === Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ jsxs(Button, {
118
119
  variant: "outline",
119
120
  size: "sm",
120
121
  className: "h-7 gap-1.5",
121
122
  onClick: () => S(!0),
122
123
  children: [/* @__PURE__ */ jsx(Play, { className: "h-3 w-3" }), "New Run"]
123
- }), t[16] = W) : W = t[16];
124
+ }), i[16] = W) : W = i[16];
124
125
  let G;
125
- t[17] === U ? G = t[18] : (G = /* @__PURE__ */ jsxs("div", {
126
+ i[17] === U ? G = i[18] : (G = /* @__PURE__ */ jsxs("div", {
126
127
  className: "bg-muted/50 flex h-11 shrink-0 items-center justify-between border-b px-3",
127
128
  children: [U, W]
128
- }), t[17] = U, t[18] = G);
129
+ }), i[17] = U, i[18] = G);
129
130
  let K;
130
- t[19] === w.error ? K = t[20] : (K = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: w.error }), t[19] = w.error, t[20] = K);
131
+ i[19] === w.error ? K = i[20] : (K = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: w.error }), i[19] = w.error, i[20] = K);
131
132
  let q;
132
- t[21] !== y || t[22] !== w.data || t[23] !== w.isLoading ? (q = y === "output" && /* @__PURE__ */ jsx("div", {
133
+ i[21] !== y || i[22] !== w.data || i[23] !== w.isLoading ? (q = y === "output" && /* @__PURE__ */ jsx("div", {
133
134
  className: "px-4 py-3",
134
135
  children: /* @__PURE__ */ jsx(LoadingCentered_default, {
135
136
  loading: w.isLoading,
@@ -140,9 +141,9 @@ function PreviewWorkbenchContent(e) {
140
141
  settings: R
141
142
  }) : null
142
143
  })
143
- }), t[21] = y, t[22] = w.data, t[23] = w.isLoading, t[24] = q) : q = t[24];
144
+ }), i[21] = y, i[22] = w.data, i[23] = w.isLoading, i[24] = q) : q = i[24];
144
145
  let J;
145
- t[25] !== y || t[26] !== w.data || t[27] !== w.isLoading || t[28] !== O || t[29] !== m ? (J = y === "graph" && /* @__PURE__ */ jsx("div", {
146
+ i[25] !== y || i[26] !== w.data || i[27] !== w.isLoading || i[28] !== O || i[29] !== m ? (J = y === "graph" && /* @__PURE__ */ jsx("div", {
146
147
  className: "h-full",
147
148
  children: /* @__PURE__ */ jsx(LoadingCentered_default, {
148
149
  loading: w.isLoading,
@@ -159,16 +160,16 @@ function PreviewWorkbenchContent(e) {
159
160
  })
160
161
  })
161
162
  })
162
- }), t[25] = y, t[26] = w.data, t[27] = w.isLoading, t[28] = O, t[29] = m, t[30] = J) : J = t[30];
163
+ }), i[25] = y, i[26] = w.data, i[27] = w.isLoading, i[28] = O, i[29] = m, i[30] = J) : J = i[30];
163
164
  let Y;
164
- t[31] !== y || t[32] !== w.data ? (Y = y === "run-log" && /* @__PURE__ */ jsx("div", {
165
+ i[31] !== y || i[32] !== w.data ? (Y = y === "run-log" && /* @__PURE__ */ jsx("div", {
165
166
  className: "px-4",
166
167
  children: /* @__PURE__ */ jsx(WorkflowHistoryList_default, { workflow: w.data })
167
- }), t[31] = y, t[32] = w.data, t[33] = Y) : Y = t[33];
168
+ }), i[31] = y, i[32] = w.data, i[33] = Y) : Y = i[33];
168
169
  let X;
169
- t[34] === y ? X = t[35] : (X = y === "logs" && /* @__PURE__ */ jsx(EmbedLogsContent, {}), t[34] = y, t[35] = X);
170
+ i[34] === y ? X = i[35] : (X = y === "logs" && /* @__PURE__ */ jsx(EmbedLogsContent, {}), i[34] = y, i[35] = X);
170
171
  let Z;
171
- t[36] !== K || t[37] !== q || t[38] !== J || t[39] !== Y || t[40] !== X ? (Z = /* @__PURE__ */ jsxs("div", {
172
+ i[36] !== K || i[37] !== q || i[38] !== J || i[39] !== Y || i[40] !== X ? (Z = /* @__PURE__ */ jsxs("div", {
172
173
  className: "flex-1 overflow-auto",
173
174
  children: [
174
175
  K,
@@ -177,15 +178,15 @@ function PreviewWorkbenchContent(e) {
177
178
  Y,
178
179
  X
179
180
  ]
180
- }), t[36] = K, t[37] = q, t[38] = J, t[39] = Y, t[40] = X, t[41] = Z) : Z = t[41];
181
+ }), i[36] = K, i[37] = q, i[38] = J, i[39] = Y, i[40] = X, i[41] = Z) : Z = i[41];
181
182
  let Q;
182
- t[42] !== F || t[43] !== x ? (Q = /* @__PURE__ */ jsx(NewRunDialog, {
183
+ i[42] !== F || i[43] !== x ? (Q = /* @__PURE__ */ jsx(NewRunDialog, {
183
184
  open: x,
184
185
  onOpenChange: S,
185
186
  onSuccess: F
186
- }), t[42] = F, t[43] = x, t[44] = Q) : Q = t[44];
187
+ }), i[42] = F, i[43] = x, i[44] = Q) : Q = i[44];
187
188
  let $;
188
- return t[45] !== G || t[46] !== Z || t[47] !== Q ? ($ = /* @__PURE__ */ jsxs("div", {
189
+ return i[45] !== G || i[46] !== Z || i[47] !== Q ? ($ = /* @__PURE__ */ jsxs("div", {
189
190
  ref: _,
190
191
  className: "flex h-screen flex-col overflow-hidden",
191
192
  children: [
@@ -193,7 +194,7 @@ function PreviewWorkbenchContent(e) {
193
194
  Z,
194
195
  Q
195
196
  ]
196
- }), t[45] = G, t[46] = Z, t[47] = Q, t[48] = $) : $ = t[48], $;
197
+ }), i[45] = G, i[46] = Z, i[47] = Q, i[48] = $) : $ = i[48], $;
197
198
  }
198
199
  function _temp() {}
199
200
  var STATUS_DOT_COLORS = {
@@ -204,17 +205,17 @@ var STATUS_DOT_COLORS = {
204
205
  canceled: "bg-orange-500",
205
206
  pending: "bg-muted-foreground"
206
207
  };
207
- function PreviewEmptyState(n) {
208
- let r = c(24), { newRunDialogOpen: a, onNewRunDialogOpenChange: o, onNewRunSuccess: s } = n, l = useNavigate(), { router: u } = useStudio(), [d, f] = useState(3), m;
209
- r[0] === Symbol.for("react.memo_cache_sentinel") ? (m = { parentId: null }, r[0] = m) : m = r[0];
208
+ function PreviewEmptyState(e) {
209
+ let t = c(24), { newRunDialogOpen: r, onNewRunDialogOpenChange: o, onNewRunSuccess: s } = e, l = useNavigate(), { router: u } = useStudio(), [d, f] = useState(3), m;
210
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (m = { parentId: null }, t[0] = m) : m = t[0];
210
211
  let h = useFilterWorkflows(void 0, m, "createdAt", "DESC", 0, d), g;
211
- r[1] === h.data?.data ? g = r[2] : (g = h.data?.data ?? [], r[1] = h.data?.data, r[2] = g);
212
+ t[1] === h.data?.data ? g = t[2] : (g = h.data?.data ?? [], t[1] = h.data?.data, t[2] = g);
212
213
  let _ = g, se = h.data?.total ?? 0, y = _.length < se, x;
213
- r[3] === o ? x = r[4] : (x = () => o(!0), r[3] = o, r[4] = x);
214
+ t[3] === o ? x = t[4] : (x = () => o(!0), t[3] = o, t[4] = x);
214
215
  let C;
215
- r[5] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(Play, { className: "h-3.5 w-3.5" }), r[5] = C) : C = r[5];
216
+ t[5] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(Play, { className: "h-3.5 w-3.5" }), t[5] = C) : C = t[5];
216
217
  let T;
217
- r[6] === x ? T = r[7] : (T = /* @__PURE__ */ jsx("div", {
218
+ t[6] === x ? T = t[7] : (T = /* @__PURE__ */ jsx("div", {
218
219
  className: "flex justify-center",
219
220
  children: /* @__PURE__ */ jsxs(Button, {
220
221
  variant: "secondary",
@@ -223,9 +224,9 @@ function PreviewEmptyState(n) {
223
224
  onClick: x,
224
225
  children: [C, "New Run"]
225
226
  })
226
- }), r[6] = x, r[7] = T);
227
+ }), t[6] = x, t[7] = T);
227
228
  let E;
228
- r[8] !== h.isLoading || r[9] !== y || r[10] !== l || r[11] !== u || r[12] !== _ ? (E = h.isLoading && _.length === 0 ? /* @__PURE__ */ jsx("div", {
229
+ t[8] !== h.isLoading || t[9] !== y || t[10] !== l || t[11] !== u || t[12] !== _ ? (E = h.isLoading && _.length === 0 ? /* @__PURE__ */ jsx("div", {
229
230
  className: "flex justify-center py-4",
230
231
  children: /* @__PURE__ */ jsx(Loader2, { className: "text-muted-foreground h-4 w-4 animate-spin" })
231
232
  }) : _.length > 0 ? /* @__PURE__ */ jsxs("div", { children: [
@@ -248,23 +249,23 @@ function PreviewEmptyState(n) {
248
249
  onClick: () => f(_temp2),
249
250
  children: [/* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" }), "Load more"]
250
251
  })
251
- ] }) : null, r[8] = h.isLoading, r[9] = y, r[10] = l, r[11] = u, r[12] = _, r[13] = E) : E = r[13];
252
+ ] }) : null, t[8] = h.isLoading, t[9] = y, t[10] = l, t[11] = u, t[12] = _, t[13] = E) : E = t[13];
252
253
  let D;
253
- r[14] !== T || r[15] !== E ? (D = /* @__PURE__ */ jsxs("div", {
254
+ t[14] !== T || t[15] !== E ? (D = /* @__PURE__ */ jsxs("div", {
254
255
  className: "w-full max-w-sm space-y-6 px-4",
255
256
  children: [T, E]
256
- }), r[14] = T, r[15] = E, r[16] = D) : D = r[16];
257
+ }), t[14] = T, t[15] = E, t[16] = D) : D = t[16];
257
258
  let O;
258
- r[17] !== a || r[18] !== o || r[19] !== s ? (O = /* @__PURE__ */ jsx(NewRunDialog, {
259
- open: a,
259
+ t[17] !== r || t[18] !== o || t[19] !== s ? (O = /* @__PURE__ */ jsx(NewRunDialog, {
260
+ open: r,
260
261
  onOpenChange: o,
261
262
  onSuccess: s
262
- }), r[17] = a, r[18] = o, r[19] = s, r[20] = O) : O = r[20];
263
+ }), t[17] = r, t[18] = o, t[19] = s, t[20] = O) : O = t[20];
263
264
  let k;
264
- return r[21] !== D || r[22] !== O ? (k = /* @__PURE__ */ jsxs("div", {
265
+ return t[21] !== D || t[22] !== O ? (k = /* @__PURE__ */ jsxs("div", {
265
266
  className: "flex h-screen flex-col items-center justify-center",
266
267
  children: [D, O]
267
- }), r[21] = D, r[22] = O, r[23] = k) : k = r[23], k;
268
+ }), t[21] = D, t[22] = O, t[23] = k) : k = t[23], k;
268
269
  }
269
270
  function _temp2(e) {
270
271
  return e + 5;
@@ -330,7 +331,7 @@ function LogLine(e) {
330
331
  function EmbedLogsContent() {
331
332
  let e = c(21), t = config_default.environment.url, n = useRef(null), r;
332
333
  e[0] === Symbol.for("react.memo_cache_sentinel") ? (r = {
333
- queryKey: ["remote-agent-app-logs"],
334
+ queryKey: ["remote-agent-app-logs", t],
334
335
  queryFn: async () => {
335
336
  let e = await fetch(`${t}/api/v1/app/logs?lines=200`, { credentials: "include" });
336
337
  if (!e.ok) {
@@ -1,5 +1,5 @@
1
- import { useStudio } from "../providers/StudioProvider.js";
2
1
  import { useFilterWorkflows } from "../hooks/useWorkflows.js";
2
+ import { useStudio } from "../providers/StudioProvider.js";
3
3
  import { Button } from "../components/ui/button.js";
4
4
  import { NewRunDialog } from "../features/workbench/components/NewRunDialog.js";
5
5
  import { RecentRunItem } from "../features/workbench/components/RecentRunItem.js";
@@ -1,8 +1,11 @@
1
+ import { useWorkflow, useWorkspace } from "../packages/react/dist/hooks/queries.js";
2
+ import "../hooks/useWorkflows.js";
3
+ import "../hooks/useWorkspaces.js";
1
4
  import { useStudio } from "../providers/StudioProvider.js";
2
- import { useWorkflow } from "../hooks/useWorkflows.js";
3
- import { useWorkspace } from "../hooks/useWorkspaces.js";
4
5
  import LoadingCentered_default from "../components/feedback/LoadingCentered.js";
5
6
  import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
7
+ import { FeatureRegistryProvider } from "../features/feature-registry/FeatureRegistryProvider.js";
8
+ import "../features/feature-registry/index.js";
6
9
  import Workbench from "../features/workbench/Workbench.js";
7
10
  import "../features/workbench/index.js";
8
11
  import { useDefaultEnvironmentPreviewUrl } from "../hooks/useEnvironmentPreviewUrl.js";
@@ -10,57 +13,60 @@ import { requireParam } from "../lib/requireParam.js";
10
13
  import { c } from "react/compiler-runtime";
11
14
  import { jsx, jsxs } from "react/jsx-runtime";
12
15
  import { useParams } from "react-router-dom";
13
- function WorkbenchPage(p) {
14
- let m = c(35), h;
15
- m[0] === p ? h = m[1] : (h = p === void 0 ? {} : p, m[0] = p, m[1] = h);
16
- let { getPreviewUrl: g, getEnvironmentPreviewUrl: _ } = h, { router: v } = useStudio(), y = useParams(), b;
17
- m[2] === y ? b = m[3] : (b = requireParam(y, "workflowId"), m[2] = y, m[3] = b);
18
- let x = useWorkflow(b), S = x.data?.workspaceId, C = useWorkspace(S), w = useDefaultEnvironmentPreviewUrl(), T = _ ?? w, E;
19
- m[4] === v ? E = m[5] : (E = v.getWorkspaces(), m[4] = v, m[5] = E);
20
- let D;
21
- m[6] === E ? D = m[7] : (D = {
16
+ function WorkbenchPage(m) {
17
+ let h = c(36), g;
18
+ h[0] === m ? g = h[1] : (g = m === void 0 ? {} : m, h[0] = m, h[1] = g);
19
+ let { getPreviewUrl: _, getEnvironmentPreviewUrl: v } = g, { router: y } = useStudio(), b = useParams(), x;
20
+ h[2] === b ? x = h[3] : (x = requireParam(b, "workflowId"), h[2] = b, h[3] = x);
21
+ let S = useWorkflow(x), C = S.data?.workspaceId, w = useWorkspace(C), T = useDefaultEnvironmentPreviewUrl(), E = v ?? T, D;
22
+ h[4] === y ? D = h[5] : (D = y.getWorkspaces(), h[4] = y, h[5] = D);
23
+ let O;
24
+ h[6] === D ? O = h[7] : (O = {
22
25
  label: "Workspaces",
23
- href: E
24
- }, m[6] = E, m[7] = D);
25
- let O = C.data?.title ?? "", k;
26
- m[8] !== v || m[9] !== S ? (k = S ? v.getWorkspace(S) : void 0, m[8] = v, m[9] = S, m[10] = k) : k = m[10];
27
- let A;
28
- m[11] !== O || m[12] !== k ? (A = {
29
- label: O,
30
- href: k
31
- }, m[11] = O, m[12] = k, m[13] = A) : A = m[13];
32
- let j = `Run #${x.data?.run}${x.data?.title ? ` (${x.data.title})` : ""}`, M;
33
- m[14] === j ? M = m[15] : (M = { label: j }, m[14] = j, m[15] = M);
34
- let N;
35
- m[16] !== D || m[17] !== A || m[18] !== M ? (N = [
36
- D,
37
- A,
38
- M
39
- ], m[16] = D, m[17] = A, m[18] = M, m[19] = N) : N = m[19];
40
- let P = N, F;
41
- m[20] === x.error ? F = m[21] : (F = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: x.error }), m[20] = x.error, m[21] = F);
42
- let I;
43
- m[22] !== P || m[23] !== x.data || m[24] !== x.error || m[25] !== x.isLoading || m[26] !== g || m[27] !== T ? (I = x.data ? /* @__PURE__ */ jsx(Workbench, {
44
- workflow: x.data,
45
- breadcrumbData: P,
46
- getPreviewUrl: g,
47
- getEnvironmentPreviewUrl: T
48
- }) : !x.isLoading && !x.error ? /* @__PURE__ */ jsx("p", {
26
+ href: D
27
+ }, h[6] = D, h[7] = O);
28
+ let k = w.data?.title ?? "", A;
29
+ h[8] !== y || h[9] !== C ? (A = C ? y.getWorkspace(C) : void 0, h[8] = y, h[9] = C, h[10] = A) : A = h[10];
30
+ let j;
31
+ h[11] !== k || h[12] !== A ? (j = {
32
+ label: k,
33
+ href: A
34
+ }, h[11] = k, h[12] = A, h[13] = j) : j = h[13];
35
+ let M = `Run #${S.data?.run}${S.data?.title ? ` (${S.data.title})` : ""}`, N;
36
+ h[14] === M ? N = h[15] : (N = { label: M }, h[14] = M, h[15] = N);
37
+ let P;
38
+ h[16] !== O || h[17] !== j || h[18] !== N ? (P = [
39
+ O,
40
+ j,
41
+ N
42
+ ], h[16] = O, h[17] = j, h[18] = N, h[19] = P) : P = h[19];
43
+ let F = P, I;
44
+ h[20] === S.error ? I = h[21] : (I = /* @__PURE__ */ jsx(ErrorSnackbar_default, { error: S.error }), h[20] = S.error, h[21] = I);
45
+ let L = S.isLoading || w.isLoading, R;
46
+ h[22] !== F || h[23] !== S.data || h[24] !== S.error || h[25] !== S.isLoading || h[26] !== w.data || h[27] !== _ || h[28] !== E ? (R = S.data && w.data ? /* @__PURE__ */ jsx(FeatureRegistryProvider, {
47
+ appName: w.data.appName,
48
+ children: /* @__PURE__ */ jsx(Workbench, {
49
+ workflow: S.data,
50
+ breadcrumbData: F,
51
+ getPreviewUrl: _,
52
+ getEnvironmentPreviewUrl: E
53
+ })
54
+ }) : !S.isLoading && !S.error ? /* @__PURE__ */ jsx("p", {
49
55
  className: "text-muted-foreground py-8 text-center text-sm",
50
56
  children: "Workflow not found."
51
- }) : null, m[22] = P, m[23] = x.data, m[24] = x.error, m[25] = x.isLoading, m[26] = g, m[27] = T, m[28] = I) : I = m[28];
52
- let L;
53
- m[29] !== x.isLoading || m[30] !== I ? (L = /* @__PURE__ */ jsx(LoadingCentered_default, {
54
- loading: x.isLoading,
55
- children: I
56
- }), m[29] = x.isLoading, m[30] = I, m[31] = L) : L = m[31];
57
- let R;
58
- return m[32] !== F || m[33] !== L ? (R = /* @__PURE__ */ jsx("div", {
57
+ }) : null, h[22] = F, h[23] = S.data, h[24] = S.error, h[25] = S.isLoading, h[26] = w.data, h[27] = _, h[28] = E, h[29] = R) : R = h[29];
58
+ let z;
59
+ h[30] !== L || h[31] !== R ? (z = /* @__PURE__ */ jsx(LoadingCentered_default, {
60
+ loading: L,
61
+ children: R
62
+ }), h[30] = L, h[31] = R, h[32] = z) : z = h[32];
63
+ let B;
64
+ return h[33] !== I || h[34] !== z ? (B = /* @__PURE__ */ jsx("div", {
59
65
  className: "flex h-svh flex-col",
60
66
  children: /* @__PURE__ */ jsxs("div", {
61
67
  className: "flex-1 overflow-hidden",
62
- children: [F, L]
68
+ children: [I, z]
63
69
  })
64
- }), m[32] = F, m[33] = L, m[34] = R) : R = m[34], R;
70
+ }), h[33] = I, h[34] = z, h[35] = B) : B = h[35], B;
65
71
  }
66
72
  export { WorkbenchPage as default };
@@ -1,6 +1,7 @@
1
+ import { useWorkflow, useWorkspace } from "../packages/react/dist/hooks/queries.js";
2
+ import { useChildWorkflows, useWorkflowConfigByName } from "../hooks/useWorkflows.js";
3
+ import "../hooks/useWorkspaces.js";
1
4
  import { useStudio } from "../providers/StudioProvider.js";
2
- import { useChildWorkflows, useWorkflow, useWorkflowConfigByName } from "../hooks/useWorkflows.js";
3
- import { useWorkspace } from "../hooks/useWorkspaces.js";
4
5
  import MainLayout_default from "../components/layout/MainLayout.js";
5
6
  import ErrorSnackbar_default from "../components/feedback/ErrorSnackbar.js";
6
7
  import { ReactFlowProvider } from "../node_modules/@xyflow/react/dist/esm/index.js";