@loopstack/loopstack-studio 0.23.1 → 0.24.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 (62) hide show
  1. package/dist/api/index.js +12 -10
  2. package/dist/api/secrets.js +16 -0
  3. package/dist/components/dynamic-form/ArrayController.js +68 -64
  4. package/dist/components/dynamic-form/Form.js +46 -40
  5. package/dist/components/dynamic-form/FormElement.js +1 -1
  6. package/dist/components/dynamic-form/FormElementHeader.js +2 -2
  7. package/dist/components/dynamic-form/ObjectController.js +24 -21
  8. package/dist/components/dynamic-form/fields/BaseFieldWrapper.js +1 -1
  9. package/dist/components/dynamic-form/fields/InputField.js +20 -19
  10. package/dist/components/dynamic-form/fields/RadioField.js +18 -18
  11. package/dist/components/dynamic-form/fields/SelectField.js +19 -19
  12. package/dist/components/dynamic-form/fields/TextareaField.js +17 -17
  13. package/dist/components/layout/MainLayout.js +18 -31
  14. package/dist/components/layout/StudioSidebar.js +168 -108
  15. package/dist/components/page/PageBreadcrumbs.js +79 -32
  16. package/dist/components/ui-widgets/UiWidget.js +36 -27
  17. package/dist/components/ui-widgets/widgets/SecretInput.js +42 -0
  18. package/dist/features/code-explorer/components/FileContentViewer.js +47 -30
  19. package/dist/features/documents/components/DocumentList.js +5 -1
  20. package/dist/features/documents/renderers/AiMessage.js +11 -11
  21. package/dist/features/documents/renderers/DocumentFormRenderer.js +17 -11
  22. package/dist/features/workbench/components/WorkbenchFilesPanel.js +32 -25
  23. package/dist/features/workbench/components/WorkbenchFloatingPanel.js +57 -49
  24. package/dist/features/workbench/components/WorkbenchIconSidebar.js +46 -34
  25. package/dist/features/workbench/components/WorkbenchSecretsPanel.js +182 -0
  26. package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +132 -117
  27. package/dist/hooks/index.js +1 -1
  28. package/dist/hooks/query-keys.js +41 -34
  29. package/dist/hooks/useSecrets.js +69 -0
  30. package/dist/index.d.ts +43 -0
  31. package/dist/index.js +2 -2
  32. package/dist/pages/DashboardPage.js +87 -35
  33. package/dist/pages/EmbedWorkbenchPage.js +43 -39
  34. package/dist/types/ai.types.js +13 -0
  35. package/package.json +2 -3
  36. package/dist/node_modules/@ai-sdk/provider/dist/index.js +0 -65
  37. package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +0 -1008
  38. package/dist/node_modules/ai/dist/index.js +0 -1083
  39. package/dist/node_modules/zod/v3/ZodError.js +0 -79
  40. package/dist/node_modules/zod/v3/errors.js +0 -6
  41. package/dist/node_modules/zod/v3/helpers/errorUtil.js +0 -5
  42. package/dist/node_modules/zod/v3/helpers/parseUtil.js +0 -90
  43. package/dist/node_modules/zod/v3/helpers/util.js +0 -72
  44. package/dist/node_modules/zod/v3/locales/en.js +0 -58
  45. package/dist/node_modules/zod/v3/types.js +0 -2425
  46. package/dist/node_modules/zod/v4/classic/errors.js +0 -21
  47. package/dist/node_modules/zod/v4/classic/iso.js +0 -29
  48. package/dist/node_modules/zod/v4/classic/parse.js +0 -4
  49. package/dist/node_modules/zod/v4/classic/schemas.js +0 -392
  50. package/dist/node_modules/zod/v4/core/api.js +0 -532
  51. package/dist/node_modules/zod/v4/core/checks.js +0 -283
  52. package/dist/node_modules/zod/v4/core/core.js +0 -44
  53. package/dist/node_modules/zod/v4/core/doc.js +0 -21
  54. package/dist/node_modules/zod/v4/core/errors.js +0 -40
  55. package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -305
  56. package/dist/node_modules/zod/v4/core/parse.js +0 -66
  57. package/dist/node_modules/zod/v4/core/regexes.js +0 -28
  58. package/dist/node_modules/zod/v4/core/registries.js +0 -38
  59. package/dist/node_modules/zod/v4/core/schemas.js +0 -863
  60. package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -220
  61. package/dist/node_modules/zod/v4/core/util.js +0 -267
  62. package/dist/node_modules/zod/v4/core/versions.js +0 -6
@@ -1,41 +1,88 @@
1
1
  import { cn } from "../../lib/utils.js";
2
- import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "../ui/breadcrumb.js";
2
+ import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "../ui/breadcrumb.js";
3
3
  import { c } from "react/compiler-runtime";
4
- import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
5
  import { useNavigate } from "react-router-dom";
6
6
  import { ChevronRight } from "lucide-react";
7
- var PageBreadcrumbs_default = (p) => {
8
- let m = c(15), { breadcrumbData: h, className: g } = p, _ = useNavigate(), v;
9
- m[0] === _ ? v = m[1] : (v = (e, d) => {
10
- e.preventDefault(), _(d);
11
- }, m[0] = _, m[1] = v);
12
- let y = v, b;
13
- m[2] === g ? b = m[3] : (b = cn("ml-3", g), m[2] = g, m[3] = b);
14
- let x;
15
- if (m[4] !== h || m[5] !== y) {
7
+ var PageBreadcrumbs_default = (g) => {
8
+ let _ = c(26), { breadcrumbData: v, className: y } = g, b = useNavigate(), x;
9
+ _[0] === b ? x = _[1] : (x = (e, m) => {
10
+ e.preventDefault(), b(m);
11
+ }, _[0] = b, _[1] = x);
12
+ let S = x, C = _temp, w = v.length > 2, T = v[0], E = v[v.length - 1], D;
13
+ _[2] === y ? D = _[3] : (D = cn("ml-3 min-w-0 max-w-full", y), _[2] = y, _[3] = D);
14
+ let O;
15
+ _[4] !== v.length || _[5] !== T || _[6] !== S || _[7] !== w || _[8] !== E ? (O = v.length <= 1 ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
16
+ /* @__PURE__ */ jsx(BreadcrumbItem, {
17
+ className: "min-w-0",
18
+ children: T.current ? /* @__PURE__ */ jsx(BreadcrumbPage, {
19
+ className: "flex min-w-0 items-center gap-2",
20
+ children: C(T)
21
+ }) : /* @__PURE__ */ jsx(BreadcrumbLink, {
22
+ href: T.href,
23
+ onClick: (e) => T.href && S(e, T.href),
24
+ className: "flex min-w-0 items-center gap-2",
25
+ title: T.label,
26
+ children: C(T)
27
+ })
28
+ }),
29
+ w ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(BreadcrumbSeparator, { children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" }) }), /* @__PURE__ */ jsx(BreadcrumbItem, { children: /* @__PURE__ */ jsx(BreadcrumbEllipsis, {}) })] }) : null,
30
+ /* @__PURE__ */ jsx(BreadcrumbSeparator, { children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" }) }),
31
+ /* @__PURE__ */ jsx(BreadcrumbItem, {
32
+ className: "min-w-0",
33
+ children: /* @__PURE__ */ jsx(BreadcrumbPage, {
34
+ className: "flex min-w-0 items-center gap-2",
35
+ title: E.label,
36
+ children: C(E)
37
+ })
38
+ })
39
+ ] }), _[4] = v.length, _[5] = T, _[6] = S, _[7] = w, _[8] = E, _[9] = O) : O = _[9];
40
+ let k;
41
+ _[10] === O ? k = _[11] : (k = /* @__PURE__ */ jsx(BreadcrumbList, {
42
+ className: "flex-nowrap overflow-hidden sm:hidden",
43
+ children: O
44
+ }), _[10] = O, _[11] = k);
45
+ let A;
46
+ if (_[12] !== v || _[13] !== S) {
16
47
  let e;
17
- m[7] !== h.length || m[8] !== y ? (e = (e, d) => {
18
- let f = d === h.length - 1;
48
+ _[15] !== v.length || _[16] !== S ? (e = (e, m) => {
49
+ let h = m === v.length - 1;
19
50
  return /* @__PURE__ */ jsxs("div", {
20
51
  className: "contents",
21
- children: [/* @__PURE__ */ jsx(BreadcrumbItem, { children: f || e.current ? /* @__PURE__ */ jsxs(BreadcrumbPage, {
22
- className: "flex items-center gap-2",
23
- children: [e.icon, e.label]
24
- }) : /* @__PURE__ */ jsxs(BreadcrumbLink, {
25
- href: e.href,
26
- onClick: (d) => e.href && y(d, e.href),
27
- className: "flex items-center gap-2",
28
- children: [e.icon, e.label]
29
- }) }), !f && /* @__PURE__ */ jsx(BreadcrumbSeparator, { children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" }) })]
30
- }, d);
31
- }, m[7] = h.length, m[8] = y, m[9] = e) : e = m[9], x = h.map(e), m[4] = h, m[5] = y, m[6] = x;
32
- } else x = m[6];
33
- let S;
34
- m[10] === x ? S = m[11] : (S = /* @__PURE__ */ jsx(Breadcrumb, { children: /* @__PURE__ */ jsx(BreadcrumbList, { children: x }) }), m[10] = x, m[11] = S);
35
- let C;
36
- return m[12] !== b || m[13] !== S ? (C = /* @__PURE__ */ jsx("div", {
37
- className: b,
38
- children: S
39
- }), m[12] = b, m[13] = S, m[14] = C) : C = m[14], C;
52
+ children: [/* @__PURE__ */ jsx(BreadcrumbItem, {
53
+ className: "min-w-0",
54
+ children: h || e.current ? /* @__PURE__ */ jsx(BreadcrumbPage, {
55
+ className: "flex min-w-0 items-center gap-2",
56
+ title: e.label,
57
+ children: C(e)
58
+ }) : /* @__PURE__ */ jsx(BreadcrumbLink, {
59
+ href: e.href,
60
+ onClick: (m) => e.href && S(m, e.href),
61
+ className: "flex min-w-0 items-center gap-2",
62
+ title: e.label,
63
+ children: C(e)
64
+ })
65
+ }), !h && /* @__PURE__ */ jsx(BreadcrumbSeparator, { children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" }) })]
66
+ }, m);
67
+ }, _[15] = v.length, _[16] = S, _[17] = e) : e = _[17], A = v.map(e), _[12] = v, _[13] = S, _[14] = A;
68
+ } else A = _[14];
69
+ let j;
70
+ _[18] === A ? j = _[19] : (j = /* @__PURE__ */ jsx(BreadcrumbList, {
71
+ className: "hidden flex-nowrap overflow-hidden sm:flex",
72
+ children: A
73
+ }), _[18] = A, _[19] = j);
74
+ let M;
75
+ _[20] !== k || _[21] !== j ? (M = /* @__PURE__ */ jsxs(Breadcrumb, { children: [k, j] }), _[20] = k, _[21] = j, _[22] = M) : M = _[22];
76
+ let N;
77
+ return _[23] !== D || _[24] !== M ? (N = /* @__PURE__ */ jsx("div", {
78
+ className: D,
79
+ children: M
80
+ }), _[23] = D, _[24] = M, _[25] = N) : N = _[25], N;
40
81
  };
82
+ function _temp(e) {
83
+ return /* @__PURE__ */ jsxs(Fragment, { children: [e.icon, /* @__PURE__ */ jsx("span", {
84
+ className: "min-w-0 truncate",
85
+ children: e.label
86
+ })] });
87
+ }
41
88
  export { PageBreadcrumbs_default as default };
@@ -1,48 +1,57 @@
1
1
  import AiPromptInput_default from "./widgets/AiPromptInput.js";
2
2
  import { ButtonFullWidth } from "./widgets/ButtonFullWidth.js";
3
3
  import { SandboxRun } from "./widgets/SandboxRun.js";
4
+ import { SecretInput } from "./widgets/SecretInput.js";
4
5
  import { SubmitButton } from "./widgets/SubmitButton.js";
5
6
  import { c } from "react/compiler-runtime";
6
7
  import React from "react";
7
8
  import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
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) {
9
+ var UiWidget_default = (l) => {
10
+ let u = c(22), { config: d, onSubmit: f, disabled: p, isLoading: m } = l, h = d.options;
11
+ switch (d.widget) {
11
12
  case "prompt-input": {
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;
13
+ let o;
14
+ return u[0] !== p || u[1] !== f || u[2] !== h ? (o = /* @__PURE__ */ jsx(AiPromptInput_default, {
15
+ disabled: p,
16
+ onSubmit: f,
17
+ ui: h
18
+ }), u[0] = p, u[1] = f, u[2] = h, u[3] = o) : o = u[3], o;
18
19
  }
19
20
  case "button": {
20
- let e = m, a;
21
- return l[4] !== f || l[5] !== p || l[6] !== d || l[7] !== e ? (a = /* @__PURE__ */ jsx(SubmitButton, {
21
+ let e = h, o;
22
+ return u[4] !== p || u[5] !== m || u[6] !== f || u[7] !== e ? (o = /* @__PURE__ */ jsx(SubmitButton, {
22
23
  ui: e,
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;
24
+ disabled: p,
25
+ onClick: f,
26
+ isLoading: m
27
+ }), u[4] = p, u[5] = m, u[6] = f, u[7] = e, u[8] = o) : o = u[8], o;
27
28
  }
28
29
  case "button-full-w": {
29
- let e = m, o;
30
- return l[9] !== f || l[10] !== p || l[11] !== d || l[12] !== e ? (o = /* @__PURE__ */ jsx(ButtonFullWidth, {
30
+ let e = h, s;
31
+ return u[9] !== p || u[10] !== m || u[11] !== f || u[12] !== e ? (s = /* @__PURE__ */ jsx(ButtonFullWidth, {
31
32
  ui: e,
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;
33
+ disabled: p,
34
+ onClick: f,
35
+ isLoading: m
36
+ }), u[9] = p, u[10] = m, u[11] = f, u[12] = e, u[13] = s) : s = u[13], s;
36
37
  }
37
38
  case "sandbox-run": {
38
- let e = m, a;
39
- return l[14] !== f || l[15] !== e ? (a = /* @__PURE__ */ jsx(SandboxRun, {
39
+ let e = h, o;
40
+ return u[14] !== p || u[15] !== e ? (o = /* @__PURE__ */ jsx(SandboxRun, {
40
41
  ui: e,
41
- disabled: f
42
- }), l[14] = f, l[15] = e, l[16] = a) : a = l[16], a;
42
+ disabled: p
43
+ }), u[14] = p, u[15] = e, u[16] = o) : o = u[16], o;
44
+ }
45
+ case "secret-input": {
46
+ let e = h, o;
47
+ return u[17] !== p || u[18] !== f || u[19] !== e ? (o = /* @__PURE__ */ jsx(SecretInput, {
48
+ ui: e,
49
+ disabled: p,
50
+ onSubmit: f
51
+ }), u[17] = p, u[18] = f, u[19] = e, u[20] = o) : o = u[20], o;
43
52
  }
44
53
  }
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;
54
+ let g;
55
+ return u[21] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx(Fragment$1, {}), u[21] = g) : g = u[21], g;
47
56
  };
48
57
  export { UiWidget_default as default };
@@ -0,0 +1,42 @@
1
+ import { Button } from "../../ui/button.js";
2
+ import { useUpsertSecret } from "../../../hooks/useSecrets.js";
3
+ import { useWorkbenchLayout } from "../../../features/workbench/providers/WorkbenchLayoutProvider.js";
4
+ import "../../../features/workbench/index.js";
5
+ import React, { useState } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { Info, KeyRound, Loader2 } from "lucide-react";
8
+ import { useFormContext } from "react-hook-form";
9
+ const SecretInput = ({ ui: u, disabled: d, onSubmit: f }) => {
10
+ let { pipeline: p } = useWorkbenchLayout(), m = p?.workspaceId, h = useFormContext(), g = useUpsertSecret(), [_, v] = useState(!1), y = async () => {
11
+ if (m) {
12
+ v(!0);
13
+ try {
14
+ let e = h.getValues().variables ?? [], c = [];
15
+ for (let l of e) !l.key?.trim() || !l.value?.trim() || (await g.mutateAsync({
16
+ workspaceId: m,
17
+ key: l.key,
18
+ value: l.value
19
+ }), c.push(l.key));
20
+ f({ keys: c });
21
+ } finally {
22
+ v(!1);
23
+ }
24
+ }
25
+ };
26
+ return /* @__PURE__ */ jsxs("div", {
27
+ className: "flex w-full flex-col gap-3",
28
+ children: [/* @__PURE__ */ jsxs("div", {
29
+ className: "text-muted-foreground flex items-center gap-2 text-xs",
30
+ children: [/* @__PURE__ */ jsx(Info, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ jsx("span", { children: "To add or remove other secrets, use the Secrets panel in the right sidebar." })]
31
+ }), /* @__PURE__ */ jsx("div", {
32
+ className: "flex justify-end",
33
+ children: /* @__PURE__ */ jsxs(Button, {
34
+ onClick: () => void y(),
35
+ disabled: d || _,
36
+ className: "w-48",
37
+ children: [_ ? /* @__PURE__ */ jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(KeyRound, { className: "mr-2 h-4 w-4" }), u?.label ?? "Save & Continue"]
38
+ })
39
+ })]
40
+ });
41
+ };
42
+ export { SecretInput };
@@ -68,7 +68,7 @@ function getLanguageForFileName(e) {
68
68
  return EXTENSION_LANGUAGE[e.includes(".") ? e.slice(e.lastIndexOf(".")).toLowerCase() : ""] ?? "plaintext";
69
69
  }
70
70
  function FileContentViewer(v) {
71
- let y = c(34), { selectedFile: b, content: x, workflowConfig: S, isLoading: C, className: w } = v, T = S === void 0 ? null : S, E = C === void 0 ? !1 : C;
71
+ let y = c(39), { selectedFile: b, content: x, workflowConfig: S, isLoading: C, className: w } = v, T = S === void 0 ? null : S, E = C === void 0 ? !1 : C;
72
72
  if (!b) {
73
73
  let h;
74
74
  y[0] === w ? h = y[1] : (h = cn("flex flex-1 items-center justify-center bg-background", w), y[0] = w, y[1] = h);
@@ -83,8 +83,8 @@ function FileContentViewer(v) {
83
83
  children: g
84
84
  }), y[3] = h, y[4] = _), _;
85
85
  }
86
- let D = isBinaryFileName(b.name), O = x ?? (D ? null : `// ${b.path ?? b.name}\n\n(No content available)`);
87
- if (D && x == null) {
86
+ let D = isBinaryFileName(b.name), O = x != null, k = x ?? "";
87
+ if (D && !O) {
88
88
  let h;
89
89
  y[5] === w ? h = y[6] : (h = cn("flex flex-1 flex-col rounded-lg border bg-background", w), y[5] = w, y[6] = h);
90
90
  let g;
@@ -101,13 +101,16 @@ function FileContentViewer(v) {
101
101
  children: g
102
102
  }), y[8] = h, y[9] = _), _;
103
103
  }
104
- if (E) {
104
+ if (!O && !E) {
105
105
  let h;
106
106
  y[10] === w ? h = y[11] : (h = cn("flex flex-1 flex-col rounded-lg border bg-background", w), y[10] = w, y[11] = h);
107
107
  let g;
108
108
  y[12] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx("div", {
109
- className: "flex justify-center p-8",
110
- children: /* @__PURE__ */ jsx(Loader2, { className: "h-6 w-6 animate-spin text-muted-foreground" })
109
+ className: "flex flex-1 items-center justify-center p-8",
110
+ children: /* @__PURE__ */ jsx("p", {
111
+ className: "text-sm text-destructive",
112
+ children: "Error loading file content"
113
+ })
111
114
  }), y[12] = g) : g = y[12];
112
115
  let _;
113
116
  return y[13] === h ? _ = y[14] : (_ = /* @__PURE__ */ jsx("div", {
@@ -115,16 +118,30 @@ function FileContentViewer(v) {
115
118
  children: g
116
119
  }), y[13] = h, y[14] = _), _;
117
120
  }
118
- let k;
119
- y[15] === b.name ? k = y[16] : (k = getLanguageForFileName(b.name), y[15] = b.name, y[16] = k);
120
- let A = k, j;
121
- y[17] !== A || y[18] !== b.name ? (j = A === "markdown" || b.name.endsWith(".md") || b.name.endsWith(".mdx"), y[17] = A, y[18] = b.name, y[19] = j) : j = y[19];
122
- let M = j, N;
123
- y[20] !== A || y[21] !== b.name ? (N = A === "yaml" || b.name.endsWith(".yaml") || b.name.endsWith(".yml"), y[20] = A, y[21] = b.name, y[22] = N) : N = y[22];
124
- let P = N && T !== null, F;
125
- y[23] === w ? F = y[24] : (F = cn("flex h-full flex-col overflow-hidden rounded-lg border bg-background", w), y[23] = w, y[24] = F);
126
- let I;
127
- y[25] !== O || y[26] !== M || y[27] !== P || y[28] !== A || y[29] !== T ? (I = M && O ? /* @__PURE__ */ jsxs(Tabs, {
121
+ if (E) {
122
+ let h;
123
+ y[15] === w ? h = y[16] : (h = cn("flex flex-1 flex-col rounded-lg border bg-background", w), y[15] = w, y[16] = h);
124
+ let g;
125
+ y[17] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx("div", {
126
+ className: "flex justify-center p-8",
127
+ children: /* @__PURE__ */ jsx(Loader2, { className: "h-6 w-6 animate-spin text-muted-foreground" })
128
+ }), y[17] = g) : g = y[17];
129
+ let _;
130
+ return y[18] === h ? _ = y[19] : (_ = /* @__PURE__ */ jsx("div", {
131
+ className: h,
132
+ children: g
133
+ }), y[18] = h, y[19] = _), _;
134
+ }
135
+ let A;
136
+ y[20] === b.name ? A = y[21] : (A = getLanguageForFileName(b.name), y[20] = b.name, y[21] = A);
137
+ let j = A, M;
138
+ y[22] !== j || y[23] !== b.name ? (M = j === "markdown" || b.name.endsWith(".md") || b.name.endsWith(".mdx"), y[22] = j, y[23] = b.name, y[24] = M) : M = y[24];
139
+ let N = M, P;
140
+ y[25] !== j || y[26] !== b.name ? (P = j === "yaml" || b.name.endsWith(".yaml") || b.name.endsWith(".yml"), y[25] = j, y[26] = b.name, y[27] = P) : P = y[27];
141
+ let F = P && T !== null, I;
142
+ y[28] === w ? I = y[29] : (I = cn("flex h-full flex-col overflow-hidden rounded-lg border bg-background", w), y[28] = w, y[29] = I);
143
+ let L;
144
+ y[30] !== k || y[31] !== N || y[32] !== F || y[33] !== j || y[34] !== T ? (L = N && k ? /* @__PURE__ */ jsxs(Tabs, {
128
145
  defaultValue: "rendered",
129
146
  className: "flex h-full flex-col overflow-hidden",
130
147
  children: [
@@ -145,7 +162,7 @@ function FileContentViewer(v) {
145
162
  className: "h-full",
146
163
  children: /* @__PURE__ */ jsx("div", {
147
164
  className: "p-4",
148
- children: /* @__PURE__ */ jsx(MarkdownContent_default, { content: O })
165
+ children: /* @__PURE__ */ jsx(MarkdownContent_default, { content: k })
149
166
  })
150
167
  })
151
168
  }),
@@ -155,7 +172,7 @@ function FileContentViewer(v) {
155
172
  children: /* @__PURE__ */ jsx(ScrollArea, {
156
173
  className: "flex-1 min-h-0",
157
174
  children: /* @__PURE__ */ jsx(Prism, {
158
- language: A,
175
+ language: j,
159
176
  style: vscDarkPlus,
160
177
  customStyle: {
161
178
  margin: 0,
@@ -165,12 +182,12 @@ function FileContentViewer(v) {
165
182
  showLineNumbers: !0,
166
183
  PreTag: "div",
167
184
  codeTagProps: { style: { fontFamily: "inherit" } },
168
- children: O ?? ""
185
+ children: k ?? ""
169
186
  })
170
187
  })
171
188
  })
172
189
  ]
173
- }) : P && T ? /* @__PURE__ */ jsxs(Tabs, {
190
+ }) : F && T ? /* @__PURE__ */ jsxs(Tabs, {
174
191
  defaultValue: "code",
175
192
  className: "flex h-full flex-col overflow-hidden",
176
193
  children: [
@@ -190,7 +207,7 @@ function FileContentViewer(v) {
190
207
  children: /* @__PURE__ */ jsx(ScrollArea, {
191
208
  className: "flex-1 min-h-0",
192
209
  children: /* @__PURE__ */ jsx(Prism, {
193
- language: A,
210
+ language: j,
194
211
  style: vscDarkPlus,
195
212
  customStyle: {
196
213
  margin: 0,
@@ -200,7 +217,7 @@ function FileContentViewer(v) {
200
217
  showLineNumbers: !0,
201
218
  PreTag: "div",
202
219
  codeTagProps: { style: { fontFamily: "inherit" } },
203
- children: O ?? ""
220
+ children: k ?? ""
204
221
  })
205
222
  })
206
223
  }),
@@ -216,7 +233,7 @@ function FileContentViewer(v) {
216
233
  }) : /* @__PURE__ */ jsx(ScrollArea, {
217
234
  className: "flex-1 min-h-0",
218
235
  children: /* @__PURE__ */ jsx(Prism, {
219
- language: A,
236
+ language: j,
220
237
  style: vscDarkPlus,
221
238
  customStyle: {
222
239
  margin: 0,
@@ -226,13 +243,13 @@ function FileContentViewer(v) {
226
243
  showLineNumbers: !0,
227
244
  PreTag: "div",
228
245
  codeTagProps: { style: { fontFamily: "inherit" } },
229
- children: O ?? ""
246
+ children: k ?? ""
230
247
  })
231
- }), y[25] = O, y[26] = M, y[27] = P, y[28] = A, y[29] = T, y[30] = I) : I = y[30];
232
- let L;
233
- return y[31] !== F || y[32] !== I ? (L = /* @__PURE__ */ jsx("div", {
234
- className: F,
235
- children: I
236
- }), y[31] = F, y[32] = I, y[33] = L) : L = y[33], L;
248
+ }), y[30] = k, y[31] = N, y[32] = F, y[33] = j, y[34] = T, y[35] = L) : L = y[35];
249
+ let R;
250
+ return y[36] !== I || y[37] !== L ? (R = /* @__PURE__ */ jsx("div", {
251
+ className: I,
252
+ children: L
253
+ }), y[36] = I, y[37] = L, y[38] = R) : R = y[38], R;
237
254
  }
238
255
  export { FileContentViewer };
@@ -21,7 +21,11 @@ var import_enums = require_enums(), DocumentList_default = (e) => {
21
21
  let e;
22
22
  o[15] !== d.length || o[16] !== v || o[17] !== l || o[18] !== p || o[19] !== u ? (e = (e, a) => {
23
23
  let o = e, s = e.place === u.place || !!o.meta?.enableAtPlaces?.includes(u.place);
24
- return /* @__PURE__ */ jsx(DocumentItem_default, {
24
+ return console.log({
25
+ isDocumentActive: s,
26
+ enableAtPlaces: o.meta?.enableAtPlaces,
27
+ place: u.place
28
+ }), /* @__PURE__ */ jsx(DocumentItem_default, {
25
29
  document: e,
26
30
  workflow: u,
27
31
  pipeline: l,
@@ -1,23 +1,23 @@
1
- import { getToolOrDynamicToolName, isReasoningUIPart, isTextUIPart, isToolOrDynamicToolUIPart } from "../../../node_modules/ai/dist/index.js";
2
1
  import { Message, MessageAction, MessageActions, MessageContent, MessageResponse } from "../../../components/ai-elements/message.js";
3
2
  import { Reasoning, ReasoningContent, ReasoningTrigger } from "../../../components/ai-elements/reasoning.js";
4
3
  import { Source, Sources, SourcesContent, SourcesTrigger } from "../../../components/ai-elements/sources.js";
5
4
  import { Tool, ToolContent, ToolHeader, ToolInput, ToolOutput } from "../../../components/ai-elements/tool.js";
5
+ import { getToolOrDynamicToolName, isReasoningUIPart, isTextUIPart, isToolOrDynamicToolUIPart } from "../../../types/ai.types.js";
6
6
  import { c } from "react/compiler-runtime";
7
7
  import { Fragment } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { CopyIcon } from "lucide-react";
10
10
  var AiMessage_default = (O) => {
11
- let k = c(13), { document: A } = O, j = A.content, M, N;
11
+ let k = c(13), { document: A } = O, j = A.content, M = _temp, N, P;
12
12
  if (k[0] !== j.id || k[1] !== j.parts || k[2] !== j.role) {
13
- let n = j.parts?.filter(_temp) ?? [];
14
- M = Fragment, N = j.role === "assistant" && n.length > 0 && /* @__PURE__ */ jsxs(Sources, { children: [/* @__PURE__ */ jsx(SourcesTrigger, { count: n.length }), n.map((n, T) => /* @__PURE__ */ jsx(SourcesContent, { children: /* @__PURE__ */ jsx(Source, {
13
+ let n = j.parts?.filter(M) ?? [];
14
+ N = Fragment, P = j.role === "assistant" && n.length > 0 && /* @__PURE__ */ jsxs(Sources, { children: [/* @__PURE__ */ jsx(SourcesTrigger, { count: n.length }), n.map((n, T) => /* @__PURE__ */ jsx(SourcesContent, { children: /* @__PURE__ */ jsx(Source, {
15
15
  href: n.url,
16
16
  title: n.url
17
- }) }, `${j.id}-source-${T}`))] }), k[0] = j.id, k[1] = j.parts, k[2] = j.role, k[3] = M, k[4] = N;
18
- } else M = k[3], N = k[4];
19
- let P;
20
- k[5] !== j.id || k[6] !== j.parts || k[7] !== j.role ? (P = j.parts?.map((E, D) => {
17
+ }) }, `${j.id}-source-${T}`))] }), k[0] = j.id, k[1] = j.parts, k[2] = j.role, k[3] = N, k[4] = P;
18
+ } else N = k[3], P = k[4];
19
+ let F;
20
+ k[5] !== j.id || k[6] !== j.parts || k[7] !== j.role ? (F = j.parts?.map((E, D) => {
21
21
  if (isTextUIPart(E)) return /* @__PURE__ */ jsxs(Message, {
22
22
  from: j.role,
23
23
  children: [/* @__PURE__ */ jsx(MessageContent, { children: /* @__PURE__ */ jsx(MessageResponse, { children: E.text }) }), j.role === "assistant" && /* @__PURE__ */ jsx(MessageActions, { children: /* @__PURE__ */ jsx(MessageAction, {
@@ -46,9 +46,9 @@ var AiMessage_default = (O) => {
46
46
  }, `${j.id}-${D}`);
47
47
  }
48
48
  return null;
49
- }), k[5] = j.id, k[6] = j.parts, k[7] = j.role, k[8] = P) : P = k[8];
50
- let F;
51
- return k[9] !== M || k[10] !== N || k[11] !== P ? (F = /* @__PURE__ */ jsxs(M, { children: [N, P] }), k[9] = M, k[10] = N, k[11] = P, k[12] = F) : F = k[12], F;
49
+ }), k[5] = j.id, k[6] = j.parts, k[7] = j.role, k[8] = F) : F = k[8];
50
+ let I;
51
+ return k[9] !== N || k[10] !== P || k[11] !== F ? (I = /* @__PURE__ */ jsxs(N, { children: [P, F] }), k[9] = N, k[10] = P, k[11] = F, k[12] = I) : I = k[12], I;
52
52
  };
53
53
  function _temp(n) {
54
54
  return n.type === "source-url";
@@ -7,7 +7,7 @@ import { jsx } from "react/jsx-runtime";
7
7
  import { useForm } from "react-hook-form";
8
8
  import "zod";
9
9
  var DocumentFormRenderer_default = (l) => {
10
- let u = c(39), { pipeline: d, workflow: f, document: p, enabled: m, viewOnly: h } = l, g = useRunPipeline(), _;
10
+ let u = c(40), { pipeline: d, workflow: f, document: p, enabled: m, viewOnly: h } = l, g = useRunPipeline(), _;
11
11
  u[0] !== p.content || u[1] !== p.schema.type ? (_ = p.schema.type === "object" ? p.content : { raw: p.content }, u[0] = p.content, u[1] = p.schema.type, u[2] = _) : _ = u[2];
12
12
  let v;
13
13
  u[3] === _ ? v = u[4] : (v = {
@@ -46,22 +46,28 @@ var DocumentFormRenderer_default = (l) => {
46
46
  p.schema.type === "object" ? T(e, s) : T(e, s.raw);
47
47
  }, u[16] = p.schema.type, u[17] = T, u[18] = E) : E = u[18];
48
48
  let D = E, O;
49
- u[19] !== y || u[20] !== D ? (O = (e) => {
50
- y.handleSubmit(D(e))();
51
- }, u[19] = y, u[20] = D, u[21] = O) : O = u[21];
52
- let k = O, A = p.ui, j = p.schema, M = A?.form?.disabled, N = !m || M || !1, P;
53
- u[22] === p.ui?.actions ? P = u[23] : (P = p.ui?.actions ?? [], u[22] = p.ui?.actions, u[23] = P);
54
- let F = P, I = A ?? void 0, L = p.meta?.mimeType, R;
55
- u[24] !== F || u[25] !== C || u[26] !== N || u[27] !== k || u[28] !== g.isPending || u[29] !== f.place ? (R = /* @__PURE__ */ jsx(UiActions_default, {
49
+ u[19] !== T || u[20] !== y || u[21] !== D ? (O = (e, s) => {
50
+ s === void 0 ? y.handleSubmit(D(e))() : T(e, s);
51
+ }, u[19] = T, u[20] = y, u[21] = D, u[22] = O) : O = u[22];
52
+ let k = O, A = p.ui, j = p.schema, M = !!A?.form?.disabled, N = !m || M || !1, P;
53
+ u[23] === p.ui?.actions ? P = u[24] : (P = p.ui?.actions ?? [], u[23] = p.ui?.actions, u[24] = P);
54
+ let F = P;
55
+ console.log({
56
+ document: p,
57
+ formDisabled: M,
58
+ enabled: m
59
+ });
60
+ let I = A ?? void 0, L = p.meta?.mimeType, R;
61
+ u[25] !== F || u[26] !== C || u[27] !== N || u[28] !== k || u[29] !== g.isPending || u[30] !== f.place ? (R = /* @__PURE__ */ jsx(UiActions_default, {
56
62
  actions: F,
57
63
  onSubmit: k,
58
64
  availableTransitions: C,
59
65
  currentPlace: f.place,
60
66
  disabled: N,
61
67
  isLoading: g.isPending
62
- }), u[24] = F, u[25] = C, u[26] = N, u[27] = k, u[28] = g.isPending, u[29] = f.place, u[30] = R) : R = u[30];
68
+ }), u[25] = F, u[26] = C, u[27] = N, u[28] = k, u[29] = g.isPending, u[30] = f.place, u[31] = R) : R = u[31];
63
69
  let z;
64
- return u[31] !== N || u[32] !== y || u[33] !== j || u[34] !== I || u[35] !== L || u[36] !== R || u[37] !== h ? (z = /* @__PURE__ */ jsx("div", {
70
+ return u[32] !== N || u[33] !== y || u[34] !== j || u[35] !== I || u[36] !== L || u[37] !== R || u[38] !== h ? (z = /* @__PURE__ */ jsx("div", {
65
71
  className: "flex",
66
72
  children: /* @__PURE__ */ jsx(Form_default, {
67
73
  form: y,
@@ -72,7 +78,7 @@ var DocumentFormRenderer_default = (l) => {
72
78
  viewOnly: h,
73
79
  actions: R
74
80
  })
75
- }), u[31] = N, u[32] = y, u[33] = j, u[34] = I, u[35] = L, u[36] = R, u[37] = h, u[38] = z) : z = u[38], z;
81
+ }), u[32] = N, u[33] = y, u[34] = j, u[35] = I, u[36] = L, u[37] = R, u[38] = h, u[39] = z) : z = u[39], z;
76
82
  };
77
83
  function _temp(e) {
78
84
  return e.id;
@@ -1,3 +1,5 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { Button } from "../../../components/ui/button.js";
1
3
  import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
2
4
  import { FileContentViewer } from "../../code-explorer/components/FileContentViewer.js";
3
5
  import "../../code-explorer/index.js";
@@ -8,28 +10,33 @@ import { c } from "react/compiler-runtime";
8
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
11
  import { X } from "lucide-react";
10
12
  function WorkbenchFilesPanel() {
11
- let d = c(9), { closeSidePanel: f, fileExplorerEnabled: p } = useWorkbenchLayout(), m = useOptionalRemoteFileExplorer();
12
- if (!p) return null;
13
- let h;
14
- d[0] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ jsx("span", {
13
+ let p = c(10), { closeSidePanel: m, fileExplorerEnabled: h } = useWorkbenchLayout(), g = useOptionalRemoteFileExplorer();
14
+ if (!h) return null;
15
+ let _;
16
+ p[0] === Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ jsx("span", {
15
17
  className: "text-sm font-medium",
16
18
  children: "Files"
17
- }), d[0] = h) : h = d[0];
18
- let g;
19
- d[1] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }), d[1] = g) : g = d[1];
20
- let _;
21
- d[2] === f ? _ = d[3] : (_ = /* @__PURE__ */ jsxs("div", {
19
+ }), p[0] = _) : _ = p[0];
20
+ let v;
21
+ p[1] === Symbol.for("react.memo_cache_sentinel") ? (v = cn("h-5 w-5 shrink-0 rounded transition-opacity", "hover:bg-destructive/10 hover:text-destructive"), p[1] = v) : v = p[1];
22
+ let y;
23
+ p[2] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" }), p[2] = y) : y = p[2];
24
+ let b;
25
+ p[3] === m ? b = p[4] : (b = /* @__PURE__ */ jsxs("div", {
22
26
  className: "border-b flex h-12 shrink-0 items-center justify-between px-3",
23
- children: [h, /* @__PURE__ */ jsx("button", {
24
- onClick: f,
25
- className: "text-muted-foreground hover:text-foreground flex h-8 w-8 items-center justify-center rounded-md transition-colors hover:cursor-pointer",
26
- children: g
27
+ children: [_, /* @__PURE__ */ jsx(Button, {
28
+ variant: "ghost",
29
+ size: "icon",
30
+ className: v,
31
+ onClick: m,
32
+ "aria-label": "Close Files Panel",
33
+ children: y
27
34
  })]
28
- }), d[2] = f, d[3] = _);
29
- let v;
30
- d[4] === m ? v = d[5] : (v = /* @__PURE__ */ jsx("div", {
35
+ }), p[3] = m, p[4] = b);
36
+ let x;
37
+ p[5] === g ? x = p[6] : (x = /* @__PURE__ */ jsx("div", {
31
38
  className: "flex-1 overflow-hidden flex",
32
- children: m ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
39
+ children: g ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
33
40
  className: "w-64 shrink-0 border-r bg-muted/40",
34
41
  children: /* @__PURE__ */ jsx(RemoteFileTree_default, {})
35
42
  }), /* @__PURE__ */ jsxs("div", {
@@ -37,9 +44,9 @@ function WorkbenchFilesPanel() {
37
44
  children: [/* @__PURE__ */ jsx(RemoteFileTabsBar, {}), /* @__PURE__ */ jsx("div", {
38
45
  className: "flex-1 overflow-hidden p-3 pt-2",
39
46
  children: /* @__PURE__ */ jsx(FileContentViewer, {
40
- selectedFile: m.selectedFile,
41
- content: m.fileContent,
42
- isLoading: m.isContentLoading,
47
+ selectedFile: g.selectedFile,
48
+ content: g.fileContent,
49
+ isLoading: g.isContentLoading,
43
50
  className: "h-full"
44
51
  })
45
52
  })]
@@ -50,11 +57,11 @@ function WorkbenchFilesPanel() {
50
57
  children: "Remote file explorer is not available for this workspace."
51
58
  })
52
59
  })
53
- }), d[4] = m, d[5] = v);
54
- let y;
55
- return d[6] !== _ || d[7] !== v ? (y = /* @__PURE__ */ jsxs("div", {
60
+ }), p[5] = g, p[6] = x);
61
+ let S;
62
+ return p[7] !== b || p[8] !== x ? (S = /* @__PURE__ */ jsxs("div", {
56
63
  className: "border-l bg-background flex w-2/3 shrink-0 flex-col",
57
- children: [_, v]
58
- }), d[6] = _, d[7] = v, d[8] = y) : y = d[8], y;
64
+ children: [b, x]
65
+ }), p[7] = b, p[8] = x, p[9] = S) : S = p[9], S;
59
66
  }
60
67
  export { WorkbenchFilesPanel };