@loopstack/loopstack-studio 0.21.3 → 0.23.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 (126) hide show
  1. package/dist/api/auth.js +10 -0
  2. package/dist/api/client.js +13 -0
  3. package/dist/api/config.js +10 -0
  4. package/dist/api/dashboard.js +4 -0
  5. package/dist/api/documents.js +7 -0
  6. package/dist/api/index.js +24 -0
  7. package/dist/api/namespaces.js +7 -0
  8. package/dist/api/pipelines.js +13 -0
  9. package/dist/api/processor.js +4 -0
  10. package/dist/api/workflows.js +8 -0
  11. package/dist/api/workspaces.js +12 -0
  12. package/dist/app/EnvironmentEmbedRoot.js +35 -0
  13. package/dist/components/data-table/DataTableFilters.js +74 -63
  14. package/dist/components/feedback/ErrorBoundary.js +43 -0
  15. package/dist/components/{LoadingCentered.js → feedback/LoadingCentered.js} +1 -1
  16. package/dist/components/feedback/index.js +5 -0
  17. package/dist/components/index.js +6 -3
  18. package/dist/components/layout/MainLayout.js +36 -17
  19. package/dist/components/layout/StudioSidebar.js +165 -0
  20. package/dist/components/page/PageBreadcrumbs.js +1 -1
  21. package/dist/components/ui/sidebar.js +359 -359
  22. package/dist/components/ui-widgets/UiActions.js +22 -15
  23. package/dist/components/ui-widgets/UiWidget.js +31 -26
  24. package/dist/components/ui-widgets/widgets/AiPromptInput.js +27 -27
  25. package/dist/components/ui-widgets/widgets/ButtonFullWidth.js +12 -12
  26. package/dist/components/ui-widgets/widgets/SandboxRun.js +33 -0
  27. package/dist/components/ui-widgets/widgets/SubmitButton.js +11 -11
  28. package/dist/features/code-explorer/CodeExplorer.js +4 -67
  29. package/dist/features/code-explorer/components/CodeExplorerTree.js +3 -41
  30. package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +4 -80
  31. package/dist/features/code-explorer/components/FileContentViewer.js +1 -0
  32. package/dist/features/code-explorer/components/FileTabsBar.js +1 -1
  33. package/dist/features/code-explorer/index.js +4 -0
  34. package/dist/features/code-explorer/utils/fileIcons.js +4 -7
  35. package/dist/features/debug/components/ConfigFlowViewer.js +1 -1
  36. package/dist/features/debug/components/PipelineFlowViewer.js +1 -1
  37. package/dist/features/debug/index.js +3 -0
  38. package/dist/features/documents/DocumentRenderer.js +53 -0
  39. package/dist/features/{workbench → documents}/components/DocumentItem.js +1 -1
  40. package/dist/features/documents/components/DocumentList.js +40 -0
  41. package/dist/features/{workbench → documents}/components/DocumentMetadataPills.js +2 -2
  42. package/dist/features/{workbench/components → documents}/document-details/DocumentDetails.js +3 -3
  43. package/dist/features/{workbench/components → documents}/document-details/PromptDetails.js +3 -3
  44. package/dist/features/documents/index.js +4 -0
  45. package/dist/features/{workbench/components/document-renderer → documents/renderers}/AiMessage.js +5 -5
  46. package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentDebugRenderer.js +1 -1
  47. package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentFormRenderer.js +9 -8
  48. package/dist/features/{workbench/components/document-renderer → documents/renderers}/DocumentMessageRenderer.js +1 -1
  49. package/dist/features/{workbench/components/document-renderer → documents/renderers}/ErrorMessageRenderer.js +1 -1
  50. package/dist/features/{workbench/components/document-renderer → documents/renderers}/LinkMessageRenderer.js +1 -1
  51. package/dist/features/{workbench/components/document-renderer → documents/renderers}/MarkdownMessageRenderer.js +2 -2
  52. package/dist/features/{workbench/components/document-renderer → documents/renderers}/PlainMessageRenderer.js +1 -1
  53. package/dist/features/health/index.js +1 -0
  54. package/dist/features/oauth/OAuthPromptRenderer.js +1 -1
  55. package/dist/features/runs/Runs.js +197 -0
  56. package/dist/features/workbench/NavigationItems.js +29 -29
  57. package/dist/features/workbench/Workbench.js +100 -78
  58. package/dist/features/workbench/WorkflowItem.js +63 -58
  59. package/dist/features/workbench/WorkflowList.js +62 -82
  60. package/dist/features/workbench/components/NewRunDialog.js +329 -0
  61. package/dist/features/workbench/components/WorkbenchFloatingPanel.js +88 -0
  62. package/dist/features/workbench/components/WorkbenchFlowPanel.js +49 -0
  63. package/dist/features/workbench/components/WorkbenchIconSidebar.js +68 -0
  64. package/dist/features/workbench/components/WorkbenchPreviewPanel.js +128 -0
  65. package/dist/features/workbench/components/WorkflowForms.js +7 -6
  66. package/dist/features/workbench/components/WorkflowHistoryItem.js +74 -69
  67. package/dist/features/workbench/components/buttons/WorkflowButtons.js +78 -61
  68. package/dist/features/workbench/hooks/useWorkflowData.js +49 -0
  69. package/dist/features/workbench/hooks/useWorkflowListState.js +50 -0
  70. package/dist/features/workbench/index.js +8 -0
  71. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +76 -0
  72. package/dist/features/workspaces/Workspaces.js +2 -2
  73. package/dist/features/workspaces/components/CreateWorkspace.js +165 -82
  74. package/dist/features/workspaces/components/EnvironmentSlotSelector.js +63 -0
  75. package/dist/features/workspaces/components/ExecutionTimeline.js +70 -69
  76. package/dist/features/workspaces/components/PipelineForm.js +4 -4
  77. package/dist/features/workspaces/index.js +3 -0
  78. package/dist/hooks/index.js +3 -0
  79. package/dist/hooks/query-keys.js +138 -0
  80. package/dist/hooks/useApi.js +9 -33
  81. package/dist/hooks/useAuth.js +37 -56
  82. package/dist/hooks/useConfig.js +27 -33
  83. package/dist/hooks/useDashboard.js +9 -16
  84. package/dist/hooks/useDebounce.js +8 -17
  85. package/dist/hooks/useDocuments.js +7 -16
  86. package/dist/hooks/useFiles.js +24 -42
  87. package/dist/hooks/useNamespaces.js +7 -16
  88. package/dist/hooks/usePipelines.js +141 -174
  89. package/dist/hooks/useProcessor.js +11 -17
  90. package/dist/hooks/useWorkflows.js +51 -89
  91. package/dist/hooks/useWorkspaces.js +97 -129
  92. package/dist/index.d.ts +364 -50
  93. package/dist/index.js +21 -6
  94. package/dist/packages/contracts/dist/enums/index.js +25 -0
  95. package/dist/packages/contracts/dist/enums/pipeline-state.js +10 -0
  96. package/dist/packages/contracts/dist/enums/registry.enum.js +20 -0
  97. package/dist/packages/contracts/dist/enums/sort-order.enum.js +10 -0
  98. package/dist/packages/contracts/dist/enums/user-type.enum.js +10 -0
  99. package/dist/packages/contracts/dist/enums/workflow-state.enum.js +10 -0
  100. package/dist/pages/DashboardPage.js +1 -1
  101. package/dist/pages/DebugPage.js +12 -14
  102. package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
  103. package/dist/pages/DebugWorkflowsPage.js +3 -4
  104. package/dist/pages/EmbedWorkbenchPage.js +7 -5
  105. package/dist/pages/PipelineDebugPage.js +7 -6
  106. package/dist/pages/PreviewWorkbenchPage.js +419 -0
  107. package/dist/pages/RunsListPage.js +64 -0
  108. package/dist/pages/RunsPage.js +49 -0
  109. package/dist/pages/StudioLandingPage.js +146 -0
  110. package/dist/pages/WorkbenchPage.js +78 -53
  111. package/dist/pages/WorkspacePage.js +1 -1
  112. package/dist/providers/InvalidationEventsProvider.js +15 -17
  113. package/dist/providers/QueryProvider.js +21 -0
  114. package/dist/providers/StudioProvider.js +2 -2
  115. package/dist/routing/LocalRouter.js +20 -7
  116. package/dist/services/createApiClient.js +4 -10
  117. package/dist/services/index.js +1 -1
  118. package/package.json +2 -3
  119. package/dist/features/workbench/components/DocumentList.js +0 -40
  120. package/dist/features/workbench/components/DocumentRenderer.js +0 -54
  121. package/dist/features/workbench/components/WorkbenchSidebar.js +0 -109
  122. package/dist/features/workbench/providers/WorkbenchContextProvider.js +0 -3
  123. /package/dist/components/{content → feedback}/ErrorAlert.js +0 -0
  124. /package/dist/components/{snackbars → feedback}/ErrorSnackbar.js +0 -0
  125. /package/dist/components/{snackbars → feedback}/Snackbar.js +0 -0
  126. /package/dist/features/{workbench/components/document-renderer → documents/renderers}/AiMessageContent.js +0 -0
@@ -3,22 +3,29 @@ import { c } from "react/compiler-runtime";
3
3
  import React, { Fragment } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  var UiActions_default = (i) => {
6
- let a = c(13), { actions: o, availableTransitions: s, disabled: l, onSubmit: u, isLoading: d } = i, f;
7
- if (a[0] !== o || a[1] !== s || a[2] !== l || a[3] !== d || a[4] !== u) {
6
+ let a = c(15), { actions: o, availableTransitions: s, currentPlace: l, disabled: u, onSubmit: d, isLoading: f } = i, p;
7
+ if (a[0] !== o || a[1] !== s || a[2] !== l || a[3] !== u || a[4] !== f || a[5] !== d) {
8
8
  let r;
9
- a[6] !== s || a[7] !== l || a[8] !== d || a[9] !== u ? (r = (r, i) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(UiWidget_default, {
10
- config: r,
11
- onSubmit: (e) => {
12
- u(r.transition, e);
13
- },
14
- disabled: l || r.transition === void 0 || !s.includes(r.transition),
15
- isLoading: d
16
- }) }, `ui-widget-${i}-${r.transition}`), a[6] = s, a[7] = l, a[8] = d, a[9] = u, a[10] = r) : r = a[10], f = o.map(r), a[0] = o, a[1] = s, a[2] = l, a[3] = d, a[4] = u, a[5] = f;
17
- } else f = a[5];
18
- let p;
19
- return a[11] === f ? p = a[12] : (p = /* @__PURE__ */ jsx("div", {
9
+ a[7] !== s || a[8] !== l || a[9] !== u || a[10] !== f || a[11] !== d ? (r = (r, i) => {
10
+ let { enabledWhen: a } = r, o = r.options?.transition;
11
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(UiWidget_default, {
12
+ config: r,
13
+ onSubmit: (e) => {
14
+ if (!o) {
15
+ console.error(`[UiActions] Widget "${r.widget ?? r.type}" has no transition configured.`);
16
+ return;
17
+ }
18
+ d(o, e);
19
+ },
20
+ disabled: u || a !== void 0 && (!l || !a.includes(l)) || o !== void 0 && !s.includes(o),
21
+ isLoading: f
22
+ }) }, `ui-widget-${i}-${o ?? r.widget}`);
23
+ }, a[7] = s, a[8] = l, a[9] = u, a[10] = f, a[11] = d, a[12] = r) : r = a[12], p = o.map(r), a[0] = o, a[1] = s, a[2] = l, a[3] = u, a[4] = f, a[5] = d, a[6] = p;
24
+ } else p = a[6];
25
+ let m;
26
+ return a[13] === p ? m = a[14] : (m = /* @__PURE__ */ jsx("div", {
20
27
  className: "flex w-full flex-col items-end gap-4",
21
- children: f
22
- }), a[11] = f, a[12] = p), p;
28
+ children: p
29
+ }), a[13] = p, a[14] = m), m;
23
30
  };
24
31
  export { UiActions_default as default };
@@ -1,43 +1,48 @@
1
1
  import AiPromptInput_default from "./widgets/AiPromptInput.js";
2
2
  import { ButtonFullWidth } from "./widgets/ButtonFullWidth.js";
3
+ import { SandboxRun } from "./widgets/SandboxRun.js";
3
4
  import { SubmitButton } from "./widgets/SubmitButton.js";
4
5
  import { c } from "react/compiler-runtime";
5
6
  import React from "react";
6
7
  import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
7
- var UiWidget_default = (o) => {
8
- let s = c(18), { config: l, onSubmit: u, disabled: d, isLoading: f } = o;
9
- switch (l.widget) {
8
+ var UiWidget_default = (s) => {
9
+ let l = c(18), { config: u, onSubmit: d, disabled: f, isLoading: p } = s, m = u.options;
10
+ switch (u.widget) {
10
11
  case "prompt-input": {
11
- let i;
12
- return s[0] !== l.options || s[1] !== l.transition || s[2] !== d || s[3] !== u ? (i = /* @__PURE__ */ jsx(AiPromptInput_default, {
13
- transition: l.transition,
14
- disabled: d,
15
- onSubmit: u,
16
- ui: l.options
17
- }), s[0] = l.options, s[1] = l.transition, s[2] = d, s[3] = u, s[4] = i) : i = s[4], i;
12
+ let a;
13
+ return l[0] !== f || l[1] !== d || l[2] !== m ? (a = /* @__PURE__ */ jsx(AiPromptInput_default, {
14
+ disabled: f,
15
+ onSubmit: d,
16
+ ui: m
17
+ }), l[0] = f, l[1] = d, l[2] = m, l[3] = a) : a = l[3], a;
18
18
  }
19
19
  case "button": {
20
- let e = l.options, i;
21
- return s[5] !== l.transition || s[6] !== d || s[7] !== f || s[8] !== u || s[9] !== e ? (i = /* @__PURE__ */ jsx(SubmitButton, {
22
- transition: l.transition,
20
+ let e = m, a;
21
+ return l[4] !== f || l[5] !== p || l[6] !== d || l[7] !== e ? (a = /* @__PURE__ */ jsx(SubmitButton, {
23
22
  ui: e,
24
- disabled: d,
25
- onClick: u,
26
- isLoading: f
27
- }), s[5] = l.transition, s[6] = d, s[7] = f, s[8] = u, s[9] = e, s[10] = i) : i = s[10], i;
23
+ disabled: f,
24
+ onClick: d,
25
+ isLoading: p
26
+ }), l[4] = f, l[5] = p, l[6] = d, l[7] = e, l[8] = a) : a = l[8], a;
28
27
  }
29
28
  case "button-full-w": {
30
- let e = l.options, a;
31
- return s[11] !== l.transition || s[12] !== d || s[13] !== f || s[14] !== u || s[15] !== e ? (a = /* @__PURE__ */ jsx(ButtonFullWidth, {
32
- transition: l.transition,
29
+ let e = m, o;
30
+ return l[9] !== f || l[10] !== p || l[11] !== d || l[12] !== e ? (o = /* @__PURE__ */ jsx(ButtonFullWidth, {
33
31
  ui: e,
34
- disabled: d,
35
- onClick: u,
36
- isLoading: f
37
- }), s[11] = l.transition, s[12] = d, s[13] = f, s[14] = u, s[15] = e, s[16] = a) : a = s[16], a;
32
+ disabled: f,
33
+ onClick: d,
34
+ isLoading: p
35
+ }), l[9] = f, l[10] = p, l[11] = d, l[12] = e, l[13] = o) : o = l[13], o;
36
+ }
37
+ case "sandbox-run": {
38
+ let e = m, a;
39
+ return l[14] !== f || l[15] !== e ? (a = /* @__PURE__ */ jsx(SandboxRun, {
40
+ ui: e,
41
+ disabled: f
42
+ }), l[14] = f, l[15] = e, l[16] = a) : a = l[16], a;
38
43
  }
39
44
  }
40
- let p;
41
- return s[17] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ jsx(Fragment$1, {}), s[17] = p) : p = s[17], p;
45
+ let h;
46
+ return l[17] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ jsx(Fragment$1, {}), l[17] = h) : h = l[17], h;
42
47
  };
43
48
  export { UiWidget_default as default };
@@ -4,40 +4,40 @@ import { useState } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Pill } from "lucide-react";
6
6
  function AiPromptInput(d) {
7
- let f = c(18), { transition: p, onSubmit: m, disabled: h, ui: g } = d, [_, v] = useState(""), y = g?.label ?? p, b;
8
- f[0] === m ? b = f[1] : (b = (e, u) => {
9
- u.preventDefault(), e.text && (m(e.text), v(""));
10
- }, f[0] = m, f[1] = b);
11
- let x;
12
- f[2] === Symbol.for("react.memo_cache_sentinel") ? (x = (e) => v(e.target.value), f[2] = x) : x = f[2];
13
- let S = h || !1, C;
14
- f[3] !== _ || f[4] !== S ? (C = /* @__PURE__ */ jsx(PromptInputBody, { children: /* @__PURE__ */ jsx(PromptInputTextarea, {
15
- value: _,
16
- onChange: x,
7
+ let f = c(18), { onSubmit: p, disabled: m, ui: h } = d, [g, _] = useState(""), v = h?.label ?? "Submit", y;
8
+ f[0] === p ? y = f[1] : (y = (e, u) => {
9
+ u.preventDefault(), e.text && (p(e.text), _(""));
10
+ }, f[0] = p, f[1] = y);
11
+ let b;
12
+ f[2] === Symbol.for("react.memo_cache_sentinel") ? (b = (e) => _(e.target.value), f[2] = b) : b = f[2];
13
+ let x = m || !1, S;
14
+ f[3] !== g || f[4] !== x ? (S = /* @__PURE__ */ jsx(PromptInputBody, { children: /* @__PURE__ */ jsx(PromptInputTextarea, {
15
+ value: g,
16
+ onChange: b,
17
17
  placeholder: "Type your message...",
18
- disabled: S,
18
+ disabled: x,
19
19
  rows: 1,
20
20
  className: "flex-1"
21
- }) }), f[3] = _, f[4] = S, f[5] = C) : C = f[5];
22
- let w;
23
- f[6] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ jsx(Pill, {
21
+ }) }), f[3] = g, f[4] = x, f[5] = S) : S = f[5];
22
+ let C;
23
+ f[6] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(Pill, {
24
24
  size: "16",
25
25
  className: "mr-2"
26
- }), f[6] = w) : w = f[6];
27
- let T;
28
- f[7] === y ? T = f[8] : (T = /* @__PURE__ */ jsxs("div", {
26
+ }), f[6] = C) : C = f[6];
27
+ let w;
28
+ f[7] === v ? w = f[8] : (w = /* @__PURE__ */ jsxs("div", {
29
29
  className: "mr-4 flex items-center",
30
- children: [w, y]
31
- }), f[7] = y, f[8] = T);
32
- let E = h || !1, D;
33
- f[9] === E ? D = f[10] : (D = /* @__PURE__ */ jsx(PromptInputSubmit, { disabled: E }), f[9] = E, f[10] = D);
30
+ children: [C, v]
31
+ }), f[7] = v, f[8] = w);
32
+ let T = m || !1, E;
33
+ f[9] === T ? E = f[10] : (E = /* @__PURE__ */ jsx(PromptInputSubmit, { disabled: T }), f[9] = T, f[10] = E);
34
+ let D;
35
+ f[11] !== w || f[12] !== E ? (D = /* @__PURE__ */ jsxs(PromptInputFooter, { children: [w, E] }), f[11] = w, f[12] = E, f[13] = D) : D = f[13];
34
36
  let O;
35
- f[11] !== T || f[12] !== D ? (O = /* @__PURE__ */ jsxs(PromptInputFooter, { children: [T, D] }), f[11] = T, f[12] = D, f[13] = O) : O = f[13];
36
- let k;
37
- return f[14] !== b || f[15] !== C || f[16] !== O ? (k = /* @__PURE__ */ jsxs(PromptInput, {
38
- onSubmit: b,
39
- children: [C, O]
40
- }), f[14] = b, f[15] = C, f[16] = O, f[17] = k) : k = f[17], k;
37
+ return f[14] !== y || f[15] !== S || f[16] !== D ? (O = /* @__PURE__ */ jsxs(PromptInput, {
38
+ onSubmit: y,
39
+ children: [S, D]
40
+ }), f[14] = y, f[15] = S, f[16] = D, f[17] = O) : O = f[17], O;
41
41
  }
42
42
  var AiPromptInput_default = AiPromptInput;
43
43
  export { AiPromptInput_default as default };
@@ -4,20 +4,20 @@ import React from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Loader2 } from "lucide-react";
6
6
  const ButtonFullWidth = (a) => {
7
- let o = c(11), { transition: s, ui: l, disabled: u, onClick: d, isLoading: f } = a, p = l?.label ?? s, m;
8
- o[0] === l?.props ? m = o[1] : (m = l?.props ?? {}, o[0] = l?.props, o[1] = m);
9
- let h = m, g = l?.variant ?? "default", _ = u || f, v;
10
- o[2] === f ? v = o[3] : (v = f && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), o[2] = f, o[3] = v);
11
- let y;
12
- return o[4] !== d || o[5] !== h || o[6] !== p || o[7] !== _ || o[8] !== v || o[9] !== g ? (y = /* @__PURE__ */ jsxs(Button, {
7
+ let o = c(11), { ui: s, disabled: l, onClick: u, isLoading: d } = a, f = s?.label ?? "Submit", p;
8
+ o[0] === s?.props ? p = o[1] : (p = s?.props ?? {}, o[0] = s?.props, o[1] = p);
9
+ let m = p, h = s?.variant ?? "default", g = l || d, _;
10
+ o[2] === d ? _ = o[3] : (_ = d && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), o[2] = d, o[3] = _);
11
+ let v;
12
+ return o[4] !== u || o[5] !== m || o[6] !== f || o[7] !== g || o[8] !== _ || o[9] !== h ? (v = /* @__PURE__ */ jsxs(Button, {
13
13
  type: "button",
14
- variant: g,
15
- ...h,
16
- disabled: _,
17
- onClick: d,
14
+ variant: h,
15
+ ...m,
16
+ disabled: g,
17
+ onClick: u,
18
18
  size: "lg",
19
19
  className: "w-full font-medium",
20
- children: [v, p]
21
- }), o[4] = d, o[5] = h, o[6] = p, o[7] = _, o[8] = v, o[9] = g, o[10] = y) : y = o[10], y;
20
+ children: [_, f]
21
+ }), o[4] = u, o[5] = m, o[6] = f, o[7] = g, o[8] = _, o[9] = h, o[10] = v) : v = o[10], v;
22
22
  };
23
23
  export { ButtonFullWidth };
@@ -0,0 +1,33 @@
1
+ import { Button } from "../../ui/button.js";
2
+ import { Tooltip, TooltipContent, TooltipTrigger } from "../../ui/tooltip.js";
3
+ import { useWorkbenchLayout } from "../../../features/workbench/providers/WorkbenchLayoutProvider.js";
4
+ import "../../../features/workbench/index.js";
5
+ import { c } from "react/compiler-runtime";
6
+ import React from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { MonitorPlay } from "lucide-react";
9
+ const SandboxRun = (u) => {
10
+ let d = c(12), { ui: f, disabled: p } = u, { openPreviewWithEnvironment: m, environments: h } = useWorkbenchLayout(), g = f?.slotId, _ = g ? h?.find((e) => e.slotId === g) : void 0, v = !!_, y = _?.envName ? `Open ${_.envName}` : "Open Sandbox", b;
11
+ d[0] !== m || d[1] !== g ? (b = () => {
12
+ g && m(g);
13
+ }, d[0] = m, d[1] = g, d[2] = b) : b = d[2];
14
+ let x = b, S = p || !v, C;
15
+ d[3] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(MonitorPlay, { className: "h-4 w-4" }), d[3] = C) : C = d[3];
16
+ let w;
17
+ d[4] !== x || d[5] !== S ? (w = /* @__PURE__ */ jsx(TooltipTrigger, {
18
+ asChild: !0,
19
+ children: /* @__PURE__ */ jsx(Button, {
20
+ type: "button",
21
+ variant: "default",
22
+ size: "icon",
23
+ disabled: S,
24
+ onClick: x,
25
+ children: C
26
+ })
27
+ }), d[4] = x, d[5] = S, d[6] = w) : w = d[6];
28
+ let T;
29
+ d[7] === y ? T = d[8] : (T = /* @__PURE__ */ jsx(TooltipContent, { children: y }), d[7] = y, d[8] = T);
30
+ let E;
31
+ return d[9] !== w || d[10] !== T ? (E = /* @__PURE__ */ jsxs(Tooltip, { children: [w, T] }), d[9] = w, d[10] = T, d[11] = E) : E = d[11], E;
32
+ };
33
+ export { SandboxRun };
@@ -4,20 +4,20 @@ import React from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Loader2 } from "lucide-react";
6
6
  const SubmitButton = (a) => {
7
- let o = c(10), { transition: s, ui: l, disabled: u, onClick: d, isLoading: f } = a, p = l?.label || s, m;
8
- o[0] === l?.props ? m = o[1] : (m = l?.props || {}, o[0] = l?.props, o[1] = m);
9
- let h = m, g = u || f, _;
10
- o[2] === f ? _ = o[3] : (_ = f && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), o[2] = f, o[3] = _);
11
- let v;
12
- return o[4] !== d || o[5] !== h || o[6] !== p || o[7] !== g || o[8] !== _ ? (v = /* @__PURE__ */ jsxs(Button, {
7
+ let o = c(10), { ui: s, disabled: l, onClick: u, isLoading: d } = a, f = s?.label || "Submit", p;
8
+ o[0] === s?.props ? p = o[1] : (p = s?.props || {}, o[0] = s?.props, o[1] = p);
9
+ let m = p, h = l || d, g;
10
+ o[2] === d ? g = o[3] : (g = d && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), o[2] = d, o[3] = g);
11
+ let _;
12
+ return o[4] !== u || o[5] !== m || o[6] !== f || o[7] !== h || o[8] !== g ? (_ = /* @__PURE__ */ jsxs(Button, {
13
13
  type: "button",
14
14
  variant: "default",
15
- ...h,
16
- disabled: g,
17
- onClick: d,
15
+ ...m,
16
+ disabled: h,
17
+ onClick: u,
18
18
  size: "default",
19
19
  className: "w-48",
20
- children: [_, p]
21
- }), o[4] = d, o[5] = h, o[6] = p, o[7] = g, o[8] = _, o[9] = v) : v = o[9], v;
20
+ children: [g, f]
21
+ }), o[4] = u, o[5] = m, o[6] = f, o[7] = h, o[8] = g, o[9] = _) : _ = o[9], _;
22
22
  };
23
23
  export { SubmitButton };
@@ -1,69 +1,6 @@
1
- import { cn } from "../../lib/utils.js";
2
- import { Input } from "../../components/ui/input.js";
3
- import { useCodeExplorerContext } from "./providers/CodeExplorerProvider.js";
4
- import { CodeExplorerTree } from "./components/CodeExplorerTree.js";
1
+ import "../../lib/utils.js";
2
+ import "../../components/ui/input.js";
3
+ import "./providers/CodeExplorerProvider.js";
4
+ import "./components/CodeExplorerTree.js";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
- function CodeExplorer(s) {
8
- let l = c(20), { className: u } = s, { fileTree: d, isTreeLoading: f, error: p, searchQuery: m, setSearchQuery: h, selectFile: g, selectedFile: _, clearSelection: v, closeFile: y } = useCodeExplorerContext(), b;
9
- l[0] === u ? b = l[1] : (b = cn("flex h-full w-full flex-col gap-2 overflow-hidden", u), l[0] = u, l[1] = b);
10
- let x;
11
- l[2] === h ? x = l[3] : (x = (e) => h(e.target.value), l[2] = h, l[3] = x);
12
- let S;
13
- l[4] !== m || l[5] !== x ? (S = /* @__PURE__ */ jsx("div", {
14
- className: "flex shrink-0 flex-col gap-2",
15
- children: /* @__PURE__ */ jsx(Input, {
16
- type: "search",
17
- placeholder: "Search files...",
18
- value: m,
19
- onChange: x,
20
- className: "h-8 w-full",
21
- "aria-label": "Search files"
22
- })
23
- }), l[4] = m, l[5] = x, l[6] = S) : S = l[6];
24
- let C;
25
- l[7] !== v || l[8] !== y || l[9] !== p || l[10] !== d || l[11] !== f || l[12] !== m || l[13] !== g || l[14] !== _?.id ? (C = /* @__PURE__ */ jsx("div", {
26
- className: "flex min-h-0 flex-1 flex-col overflow-hidden",
27
- children: /* @__PURE__ */ jsx("div", {
28
- className: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-md border bg-background",
29
- children: p ? /* @__PURE__ */ jsx("div", {
30
- className: "flex flex-1 flex-col items-center justify-center p-6 text-center",
31
- children: /* @__PURE__ */ jsxs("div", {
32
- className: "rounded-lg border border-destructive bg-destructive/10 p-4 max-w-md",
33
- children: [/* @__PURE__ */ jsx("p", {
34
- className: "text-sm font-semibold text-destructive mb-2",
35
- children: "File Explorer Error"
36
- }), /* @__PURE__ */ jsx("p", {
37
- className: "text-xs text-destructive/90",
38
- children: p.message
39
- })]
40
- })
41
- }) : f ? /* @__PURE__ */ jsx("div", {
42
- className: "flex flex-1 items-center justify-center p-4",
43
- children: /* @__PURE__ */ jsx("p", {
44
- className: "text-xs text-muted-foreground",
45
- children: "Loading file tree..."
46
- })
47
- }) : d.length === 0 ? /* @__PURE__ */ jsx("div", {
48
- className: "flex flex-1 items-center justify-center p-4",
49
- children: /* @__PURE__ */ jsx("p", {
50
- className: "text-xs text-muted-foreground",
51
- children: "No files found"
52
- })
53
- }) : /* @__PURE__ */ jsx(CodeExplorerTree, {
54
- nodes: d,
55
- searchQuery: m,
56
- onSelectFile: g,
57
- onClearSelection: v,
58
- onCloseFile: y,
59
- selectedFileId: _?.id
60
- })
61
- })
62
- }), l[7] = v, l[8] = y, l[9] = p, l[10] = d, l[11] = f, l[12] = m, l[13] = g, l[14] = _?.id, l[15] = C) : C = l[15];
63
- let w;
64
- return l[16] !== b || l[17] !== S || l[18] !== C ? (w = /* @__PURE__ */ jsxs("div", {
65
- className: b,
66
- children: [S, C]
67
- }), l[16] = b, l[17] = S, l[18] = C, l[19] = w) : w = l[19], w;
68
- }
69
- export { CodeExplorer };
@@ -1,43 +1,5 @@
1
- import { ScrollArea } from "../../../components/ui/scroll-area.js";
2
- import { useCodeExplorerContext } from "../providers/CodeExplorerProvider.js";
3
- import { CodeExplorerTreeNode } from "./CodeExplorerTreeNode.js";
1
+ import "../../../components/ui/scroll-area.js";
2
+ import "../providers/CodeExplorerProvider.js";
3
+ import "./CodeExplorerTreeNode.js";
4
4
  import { useMemo } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
- function filterTree(e, i) {
7
- if (!i.trim()) return e;
8
- let a = i.trim().toLowerCase();
9
- return e.map((e) => filterNode(e, a)).filter((e) => e !== null);
10
- }
11
- function filterNode(e, i) {
12
- if (e.type === "file") return e.name.toLowerCase().includes(i) ? e : null;
13
- let a = e.children ? e.children.map((e) => filterNode(e, i)).filter((e) => e !== null) : [];
14
- return e.name.toLowerCase().includes(i) || a.length > 0 ? {
15
- ...e,
16
- children: a
17
- } : null;
18
- }
19
- function CodeExplorerTree({ nodes: o, searchQuery: s = "", onSelectFile: c, onClearSelection: l, onCloseFile: u, selectedFileId: d }) {
20
- let f = useMemo(() => filterTree(o, s), [o, s]), { expandedFolders: p, toggleFolder: m } = useCodeExplorerContext();
21
- return /* @__PURE__ */ jsx(ScrollArea, {
22
- className: "h-full w-full",
23
- children: /* @__PURE__ */ jsx("div", {
24
- className: "w-full py-1",
25
- role: "tree",
26
- "aria-label": "File tree",
27
- children: f.length === 0 ? /* @__PURE__ */ jsx("p", {
28
- className: "px-2 py-4 text-sm text-muted-foreground",
29
- children: "No files match"
30
- }) : f.map((e) => /* @__PURE__ */ jsx(CodeExplorerTreeNode, {
31
- node: e,
32
- depth: 0,
33
- onSelectFile: c,
34
- onClearSelection: l,
35
- onCloseFile: u,
36
- selectedFileId: d,
37
- expandedFolders: p,
38
- toggleFolder: m
39
- }, e.id))
40
- })
41
- });
42
- }
43
- export { CodeExplorerTree };
@@ -1,82 +1,6 @@
1
- import { cn } from "../../../lib/utils.js";
2
- import { Button } from "../../../components/ui/button.js";
3
- import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../../components/ui/collapsible.js";
4
- import { getFileIcon, getFolderIcon } from "../utils/fileIcons.js";
1
+ import "../../../lib/utils.js";
2
+ import "../../../components/ui/button.js";
3
+ import "../../../components/ui/collapsible.js";
4
+ import "../utils/fileIcons.js";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { ChevronDown, ChevronRight, X } from "lucide-react";
7
- var INDENT_PX = 16, BASE_PADDING_PX = 8;
8
- function CodeExplorerTreeNode({ node: h, depth: g, onSelectFile: _, onClearSelection: v, onCloseFile: y, isSelected: b = !1, selectedFileId: x, expandedFolders: S = /* @__PURE__ */ new Set(), toggleFolder: C }) {
9
- let w = S.has(h.id), T = g * INDENT_PX + BASE_PADDING_PX, E = x === h.id || b;
10
- if (h.type === "file") {
11
- let m = getFileIcon(h.name);
12
- return /* @__PURE__ */ jsxs("div", {
13
- className: cn("flex w-full min-w-0 items-center gap-2 rounded-sm py-1 group", "text-muted-foreground", E && "bg-muted"),
14
- style: { paddingLeft: T },
15
- children: [/* @__PURE__ */ jsxs("button", {
16
- type: "button",
17
- className: cn("flex flex-1 min-w-0 items-center gap-2 rounded-sm text-left text-sm hover:bg-muted/50", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),
18
- onClick: () => _?.(h),
19
- "aria-label": `Select file ${h.name}`,
20
- children: [/* @__PURE__ */ jsx(m, {
21
- className: "h-4 w-4 shrink-0 text-muted-foreground",
22
- "aria-hidden": !0
23
- }), /* @__PURE__ */ jsx("span", {
24
- className: "truncate",
25
- children: h.name
26
- })]
27
- }), E && (y || v) && /* @__PURE__ */ jsx(Button, {
28
- variant: "ghost",
29
- size: "icon",
30
- className: "h-6 w-6 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",
31
- onClick: (e) => {
32
- e.stopPropagation(), y ? y(h) : v && v();
33
- },
34
- "aria-label": "Close file",
35
- children: /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" })
36
- })]
37
- });
38
- }
39
- let D = h.children && h.children.length > 0, O = getFolderIcon(w);
40
- return /* @__PURE__ */ jsxs(Collapsible, {
41
- open: w,
42
- onOpenChange: () => {
43
- C && C(h.id);
44
- },
45
- children: [/* @__PURE__ */ jsxs(CollapsibleTrigger, {
46
- className: cn("flex w-full min-w-0 items-center gap-1 rounded-sm py-1 text-left text-sm hover:bg-muted", "text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:cursor-default disabled:opacity-50"),
47
- style: { paddingLeft: T },
48
- disabled: !D,
49
- "aria-label": `${w ? "Collapse" : "Expand"} folder ${h.name}`,
50
- children: [
51
- D ? jsx(w ? ChevronDown : ChevronRight, {
52
- className: "h-4 w-4 shrink-0",
53
- "aria-hidden": !0
54
- }) : /* @__PURE__ */ jsx("span", {
55
- className: "w-4 shrink-0",
56
- "aria-hidden": !0
57
- }),
58
- /* @__PURE__ */ jsx(O, {
59
- className: "h-4 w-4 shrink-0 text-muted-foreground",
60
- "aria-hidden": !0
61
- }),
62
- /* @__PURE__ */ jsx("span", {
63
- className: "truncate",
64
- children: h.name
65
- })
66
- ]
67
- }), D && /* @__PURE__ */ jsx(CollapsibleContent, {
68
- className: "h-full",
69
- children: h.children.map((e) => /* @__PURE__ */ jsx(CodeExplorerTreeNode, {
70
- node: e,
71
- depth: g + 1,
72
- onSelectFile: _,
73
- onClearSelection: v,
74
- onCloseFile: y,
75
- selectedFileId: x,
76
- expandedFolders: S,
77
- toggleFolder: C
78
- }, e.id))
79
- })]
80
- });
81
- }
82
- export { CodeExplorerTreeNode };
@@ -4,6 +4,7 @@ import MarkdownContent_default from "../../../components/dynamic-form/MarkdownCo
4
4
  import { ReactFlowProvider } from "../../../node_modules/@xyflow/react/dist/esm/index.js";
5
5
  import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../../components/ui/tabs.js";
6
6
  import ConfigFlowViewer_default from "../../debug/components/ConfigFlowViewer.js";
7
+ import "../../debug/index.js";
7
8
  import { c } from "react/compiler-runtime";
8
9
  import { jsx, jsxs } from "react/jsx-runtime";
9
10
  import { Loader2 } from "lucide-react";
@@ -2,9 +2,9 @@ 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 { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger } from "../../../components/ui/context-menu.js";
6
5
  import { useCodeExplorerContext } from "../providers/CodeExplorerProvider.js";
7
6
  import { getFileIcon } from "../utils/fileIcons.js";
7
+ import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuSeparator, ContextMenuTrigger } from "../../../components/ui/context-menu.js";
8
8
  import { c } from "react/compiler-runtime";
9
9
  import { useEffect, useRef } from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -0,0 +1,4 @@
1
+ import { CodeExplorerProvider, useCodeExplorerContext } from "./providers/CodeExplorerProvider.js";
2
+ import "./CodeExplorer.js";
3
+ import { FileContentViewer } from "./components/FileContentViewer.js";
4
+ import { FileTabsBar } from "./components/FileTabsBar.js";
@@ -1,4 +1,4 @@
1
- import { File, FileCode, FileJson, FileText, Folder, FolderOpen } from "lucide-react";
1
+ import { File, FileCode, FileJson, FileText } from "lucide-react";
2
2
  var EXTENSION_ICON_MAP = {
3
3
  ".ts": FileCode,
4
4
  ".tsx": FileCode,
@@ -33,10 +33,7 @@ var EXTENSION_ICON_MAP = {
33
33
  ".log": FileText,
34
34
  ".env": FileText
35
35
  };
36
- function getFileIcon(c) {
37
- return EXTENSION_ICON_MAP[c.includes(".") ? c.slice(c.lastIndexOf(".")).toLowerCase() : ""] ?? File;
36
+ function getFileIcon(a) {
37
+ return EXTENSION_ICON_MAP[a.includes(".") ? a.slice(a.lastIndexOf(".")).toLowerCase() : ""] ?? File;
38
38
  }
39
- function getFolderIcon(e) {
40
- return e ? FolderOpen : Folder;
41
- }
42
- export { getFileIcon, getFolderIcon };
39
+ export { getFileIcon };
@@ -1,7 +1,7 @@
1
1
  import { Background, BackgroundVariant, Controls, index, useEdgesState, useNodesState, useReactFlow } from "../../../node_modules/@xyflow/react/dist/esm/index.js";
2
2
  /* empty css */
3
- import { buildWorkflowGraph } from "../lib/flow-utils.js";
4
3
  import StateNode_default from "./pipeline-flow/StateNode.js";
4
+ import { buildWorkflowGraph } from "../lib/flow-utils.js";
5
5
  import WorkflowTransitionEdge_default from "./pipeline-flow/WorkflowTransitionEdge.js";
6
6
  import { c } from "react/compiler-runtime";
7
7
  import React, { useEffect, useRef } from "react";
@@ -2,8 +2,8 @@ import { usePipeline } from "../../../hooks/usePipelines.js";
2
2
  import { Background, BackgroundVariant, Controls, index, useEdgesState, useNodesState, useReactFlow } from "../../../node_modules/@xyflow/react/dist/esm/index.js";
3
3
  /* empty css */
4
4
  import StateNode_default from "./pipeline-flow/StateNode.js";
5
- import WorkflowTransitionEdge_default from "./pipeline-flow/WorkflowTransitionEdge.js";
6
5
  import WorkflowGraph_default from "./pipeline-flow/WorkflowGraph.js";
6
+ import WorkflowTransitionEdge_default from "./pipeline-flow/WorkflowTransitionEdge.js";
7
7
  import { c } from "react/compiler-runtime";
8
8
  import React, { useCallback, useEffect, useRef, useState } from "react";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -0,0 +1,3 @@
1
+ import PipelineFlowViewer_default from "./components/PipelineFlowViewer.js";
2
+ import PipelineDebugHeader_default from "./components/PipelineDebugHeader.js";
3
+ import ConfigFlowViewer_default from "./components/ConfigFlowViewer.js";
@@ -0,0 +1,53 @@
1
+ import CompletionMessagePaper_default from "../../components/messages/CompletionMessagePaper.js";
2
+ import OAuthPromptRenderer_default from "../oauth/OAuthPromptRenderer.js";
3
+ import "../oauth/index.js";
4
+ import AiMessage_default from "./renderers/AiMessage.js";
5
+ import DocumentDebugRenderer_default from "./renderers/DocumentDebugRenderer.js";
6
+ import DocumentFormRenderer_default from "./renderers/DocumentFormRenderer.js";
7
+ import DocumentMessageRenderer_default from "./renderers/DocumentMessageRenderer.js";
8
+ import ErrorMessageRenderer_default from "./renderers/ErrorMessageRenderer.js";
9
+ import LinkMessageRenderer_default from "./renderers/LinkMessageRenderer.js";
10
+ import MarkdownMessageRenderer_default from "./renderers/MarkdownMessageRenderer.js";
11
+ import PlainMessageRenderer_default from "./renderers/PlainMessageRenderer.js";
12
+ import { c } from "react/compiler-runtime";
13
+ import React from "react";
14
+ import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
15
+ var rendererRegistry = new Map([
16
+ ["ai-message", ({ document: e, isLastItem: f }) => /* @__PURE__ */ jsx(AiMessage_default, {
17
+ document: e,
18
+ isLastItem: f
19
+ })],
20
+ ["debug", ({ document: e }) => /* @__PURE__ */ jsx("div", {
21
+ className: "mb-4 flex",
22
+ children: /* @__PURE__ */ jsx(DocumentDebugRenderer_default, { document: e })
23
+ })],
24
+ ["object-form", ({ pipeline: f, workflow: p, document: m, isActive: g }) => /* @__PURE__ */ jsx(CompletionMessagePaper_default, {
25
+ role: "document",
26
+ fullWidth: !0,
27
+ timestamp: new Date(m.createdAt),
28
+ children: /* @__PURE__ */ jsx(DocumentFormRenderer_default, {
29
+ pipeline: f,
30
+ workflow: p,
31
+ document: m,
32
+ enabled: g,
33
+ viewOnly: !g
34
+ })
35
+ })],
36
+ ["message", ({ document: e }) => /* @__PURE__ */ jsx(DocumentMessageRenderer_default, { document: e })],
37
+ ["error", ({ document: e }) => /* @__PURE__ */ jsx(ErrorMessageRenderer_default, { document: e })],
38
+ ["plain", ({ document: e }) => /* @__PURE__ */ jsx(PlainMessageRenderer_default, { document: e })],
39
+ ["markdown", ({ document: e }) => /* @__PURE__ */ jsx(MarkdownMessageRenderer_default, { document: e })],
40
+ ["link", ({ document: e }) => /* @__PURE__ */ jsx(LinkMessageRenderer_default, { document: e })],
41
+ ["oauth-prompt", ({ pipeline: e, workflow: p, document: m, isActive: h }) => /* @__PURE__ */ jsx(OAuthPromptRenderer_default, {
42
+ pipeline: e,
43
+ workflow: p,
44
+ document: m,
45
+ isActive: h
46
+ })]
47
+ ]), DocumentRenderer_default = (e) => {
48
+ let f = c(5), p = e.document.ui?.form?.widget ?? "object-form", m;
49
+ f[0] === p ? m = f[1] : (m = rendererRegistry.get(p), f[0] = p, f[1] = m);
50
+ let h = m, g;
51
+ return f[2] !== h || f[3] !== e ? (g = /* @__PURE__ */ jsx("div", { children: h ? /* @__PURE__ */ jsx(h, { ...e }) : /* @__PURE__ */ jsx(Fragment$1, { children: "unknown document type" }) }), f[2] = h, f[3] = e, f[4] = g) : g = f[4], g;
52
+ };
53
+ export { DocumentRenderer_default as default };