@loopstack/loopstack-studio 0.23.0 → 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 (90) 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 +56 -27
  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/InputController.js +3 -1
  8. package/dist/components/dynamic-form/ObjectController.js +24 -21
  9. package/dist/components/dynamic-form/fields/BaseFieldWrapper.js +1 -1
  10. package/dist/components/dynamic-form/fields/InputField.js +20 -19
  11. package/dist/components/dynamic-form/fields/MarkdownViewField.js +20 -0
  12. package/dist/components/dynamic-form/fields/RadioField.js +18 -18
  13. package/dist/components/dynamic-form/fields/SelectField.js +19 -19
  14. package/dist/components/dynamic-form/fields/TextareaField.js +17 -17
  15. package/dist/components/layout/MainLayout.js +18 -31
  16. package/dist/components/layout/StudioSidebar.js +168 -108
  17. package/dist/components/page/PageBreadcrumbs.js +79 -32
  18. package/dist/components/ui-widgets/UiWidget.js +36 -27
  19. package/dist/components/ui-widgets/widgets/SecretInput.js +42 -0
  20. package/dist/features/code-explorer/components/CodeExplorerTreeNode.js +80 -4
  21. package/dist/features/code-explorer/components/FileContentViewer.js +47 -30
  22. package/dist/features/code-explorer/components/FileTabsBar.js +3 -190
  23. package/dist/features/code-explorer/components/FileTabsBarBase.js +190 -0
  24. package/dist/features/code-explorer/index.js +2 -2
  25. package/dist/features/code-explorer/providers/CodeExplorerProvider.js +2 -162
  26. package/dist/features/code-explorer/utils/fileIcons.js +7 -4
  27. package/dist/features/debug/components/PipelineFlowViewer.js +46 -45
  28. package/dist/features/debug/components/pipeline-flow/WorkflowGraph.js +19 -19
  29. package/dist/features/documents/DocumentRenderer.js +20 -15
  30. package/dist/features/documents/components/DocumentList.js +5 -1
  31. package/dist/features/documents/renderers/AiMessage.js +11 -11
  32. package/dist/features/documents/renderers/ClaudeMessage.js +96 -0
  33. package/dist/features/documents/renderers/DocumentFormRenderer.js +17 -11
  34. package/dist/features/workbench/Workbench.js +64 -80
  35. package/dist/features/workbench/WorkflowItem.js +5 -5
  36. package/dist/features/workbench/components/RemoteFileTabsBar.js +18 -0
  37. package/dist/features/workbench/components/RemoteFileTree.js +90 -0
  38. package/dist/features/workbench/components/WorkbenchFilesPanel.js +67 -0
  39. package/dist/features/workbench/components/WorkbenchFloatingPanel.js +57 -49
  40. package/dist/features/workbench/components/WorkbenchFlowPanel.js +2 -2
  41. package/dist/features/workbench/components/WorkbenchIconSidebar.js +48 -28
  42. package/dist/features/workbench/components/WorkbenchSecretsPanel.js +182 -0
  43. package/dist/features/workbench/hooks/useWorkflowData.js +4 -4
  44. package/dist/features/workbench/providers/RemoteFileExplorerProvider.js +160 -0
  45. package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +46 -43
  46. package/dist/features/workspaces/components/PipelineForm.js +1 -1
  47. package/dist/features/workspaces/components/WorkspaceHomePage.js +93 -0
  48. package/dist/hooks/index.js +1 -1
  49. package/dist/hooks/query-keys.js +41 -34
  50. package/dist/hooks/useFiles.js +1 -43
  51. package/dist/hooks/useSecrets.js +69 -0
  52. package/dist/index.d.ts +49 -0
  53. package/dist/index.js +3 -2
  54. package/dist/node_modules/@xyflow/react/dist/esm/index.js +1 -1
  55. package/dist/pages/DashboardPage.js +87 -35
  56. package/dist/pages/EmbedWorkbenchPage.js +43 -39
  57. package/dist/pages/PipelineDebugPage.js +1 -1
  58. package/dist/pages/PreviewWorkbenchPage.js +167 -70
  59. package/dist/pages/WorkspacePage.js +102 -50
  60. package/dist/pages/WorkspaceRunsPage.js +71 -0
  61. package/dist/routing/LocalRouter.js +6 -0
  62. package/dist/types/ai.types.js +13 -0
  63. package/package.json +2 -3
  64. package/dist/node_modules/@ai-sdk/provider/dist/index.js +0 -65
  65. package/dist/node_modules/@ai-sdk/provider-utils/dist/index.js +0 -1008
  66. package/dist/node_modules/ai/dist/index.js +0 -1083
  67. package/dist/node_modules/zod/v3/ZodError.js +0 -79
  68. package/dist/node_modules/zod/v3/errors.js +0 -6
  69. package/dist/node_modules/zod/v3/helpers/errorUtil.js +0 -5
  70. package/dist/node_modules/zod/v3/helpers/parseUtil.js +0 -90
  71. package/dist/node_modules/zod/v3/helpers/util.js +0 -72
  72. package/dist/node_modules/zod/v3/locales/en.js +0 -58
  73. package/dist/node_modules/zod/v3/types.js +0 -2425
  74. package/dist/node_modules/zod/v4/classic/errors.js +0 -21
  75. package/dist/node_modules/zod/v4/classic/iso.js +0 -29
  76. package/dist/node_modules/zod/v4/classic/parse.js +0 -4
  77. package/dist/node_modules/zod/v4/classic/schemas.js +0 -392
  78. package/dist/node_modules/zod/v4/core/api.js +0 -532
  79. package/dist/node_modules/zod/v4/core/checks.js +0 -283
  80. package/dist/node_modules/zod/v4/core/core.js +0 -44
  81. package/dist/node_modules/zod/v4/core/doc.js +0 -21
  82. package/dist/node_modules/zod/v4/core/errors.js +0 -40
  83. package/dist/node_modules/zod/v4/core/json-schema-processors.js +0 -305
  84. package/dist/node_modules/zod/v4/core/parse.js +0 -66
  85. package/dist/node_modules/zod/v4/core/regexes.js +0 -28
  86. package/dist/node_modules/zod/v4/core/registries.js +0 -38
  87. package/dist/node_modules/zod/v4/core/schemas.js +0 -863
  88. package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -220
  89. package/dist/node_modules/zod/v4/core/util.js +0 -267
  90. package/dist/node_modules/zod/v4/core/versions.js +0 -6
@@ -3,7 +3,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from "../../../components/ui/
3
3
  import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
4
4
  import { c } from "react/compiler-runtime";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
- import { ListOrdered, MonitorPlay, Navigation, Workflow } from "lucide-react";
6
+ import { Files, KeyRound, ListOrdered, MonitorPlay, Navigation, Workflow } from "lucide-react";
7
7
  function IconButton(s) {
8
8
  let l = c(11), { icon: u, label: d, active: f, onClick: p } = s, m = f ? "bg-foreground text-background" : "text-muted-foreground hover:bg-accent/50 hover:text-accent-foreground", h;
9
9
  l[0] === m ? h = l[1] : (h = cn("flex h-10 w-10 items-center justify-center rounded-md transition-colors hover:cursor-pointer", m), l[0] = m, l[1] = h);
@@ -25,44 +25,64 @@ function IconButton(s) {
25
25
  return l[8] !== g || l[9] !== _ ? (v = /* @__PURE__ */ jsxs(Tooltip, { children: [g, _] }), l[8] = g, l[9] = _, l[10] = v) : v = l[10], v;
26
26
  }
27
27
  function WorkbenchIconSidebar() {
28
- let e = c(20), { previewPanelEnabled: i, isDeveloperMode: a, activeFloatingPanel: o, toggleFloatingPanel: h, activeSidePanel: g, toggleSidePanel: _ } = useWorkbenchLayout(), v;
29
- e[0] !== g || e[1] !== i || e[2] !== _ ? (v = i && /* @__PURE__ */ jsx(IconButton, {
28
+ let e = c(32), { previewPanelEnabled: i, fileExplorerEnabled: a, isDeveloperMode: o, activeFloatingPanel: _, toggleFloatingPanel: v, activeSidePanel: y, toggleSidePanel: b } = useWorkbenchLayout(), x;
29
+ e[0] !== y || e[1] !== i || e[2] !== b ? (x = i && /* @__PURE__ */ jsx(IconButton, {
30
30
  icon: /* @__PURE__ */ jsx(MonitorPlay, { className: "h-5 w-5" }),
31
31
  label: "Preview",
32
- active: g === "preview",
33
- onClick: () => _("preview")
34
- }), e[0] = g, e[1] = i, e[2] = _, e[3] = v) : v = e[3];
35
- let y;
36
- e[4] !== o || e[5] !== g || e[6] !== a || e[7] !== h || e[8] !== _ ? (y = a && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(IconButton, {
32
+ active: y === "preview",
33
+ onClick: () => b("preview")
34
+ }), e[0] = y, e[1] = i, e[2] = b, e[3] = x) : x = e[3];
35
+ let S;
36
+ e[4] !== _ || e[5] !== y || e[6] !== o || e[7] !== v || e[8] !== b ? (S = o && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(IconButton, {
37
37
  icon: /* @__PURE__ */ jsx(Workflow, { className: "h-5 w-5" }),
38
38
  label: "Graph",
39
- active: g === "flow",
40
- onClick: () => _("flow")
39
+ active: y === "flow",
40
+ onClick: () => b("flow")
41
41
  }), /* @__PURE__ */ jsx(IconButton, {
42
42
  icon: /* @__PURE__ */ jsx(ListOrdered, { className: "h-5 w-5" }),
43
43
  label: "Run Log",
44
- active: o === "history",
45
- onClick: () => h("history")
46
- })] }), e[4] = o, e[5] = g, e[6] = a, e[7] = h, e[8] = _, e[9] = y) : y = e[9];
47
- let b;
48
- e[10] === Symbol.for("react.memo_cache_sentinel") ? (b = /* @__PURE__ */ jsx(Navigation, { className: "h-5 w-5" }), e[10] = b) : b = e[10];
49
- let x = o === "navigation", S;
50
- e[11] === h ? S = e[12] : (S = () => h("navigation"), e[11] = h, e[12] = S);
44
+ active: _ === "history",
45
+ onClick: () => v("history")
46
+ })] }), e[4] = _, e[5] = y, e[6] = o, e[7] = v, e[8] = b, e[9] = S) : S = e[9];
51
47
  let C;
52
- e[13] !== x || e[14] !== S ? (C = /* @__PURE__ */ jsx(IconButton, {
53
- icon: b,
48
+ e[10] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(Navigation, { className: "h-5 w-5" }), e[10] = C) : C = e[10];
49
+ let w = _ === "navigation", T;
50
+ e[11] === v ? T = e[12] : (T = () => v("navigation"), e[11] = v, e[12] = T);
51
+ let E;
52
+ e[13] !== w || e[14] !== T ? (E = /* @__PURE__ */ jsx(IconButton, {
53
+ icon: C,
54
54
  label: "Navigate",
55
- active: x,
56
- onClick: S
57
- }), e[13] = x, e[14] = S, e[15] = C) : C = e[15];
58
- let w;
59
- return e[16] !== v || e[17] !== y || e[18] !== C ? (w = /* @__PURE__ */ jsxs("div", {
55
+ active: w,
56
+ onClick: T
57
+ }), e[13] = w, e[14] = T, e[15] = E) : E = e[15];
58
+ let D;
59
+ e[16] !== y || e[17] !== a || e[18] !== b ? (D = a && /* @__PURE__ */ jsx(IconButton, {
60
+ icon: /* @__PURE__ */ jsx(Files, { className: "h-5 w-5" }),
61
+ label: "Files",
62
+ active: y === "files",
63
+ onClick: () => b("files")
64
+ }), e[16] = y, e[17] = a, e[18] = b, e[19] = D) : D = e[19];
65
+ let O;
66
+ e[20] === Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ jsx(KeyRound, { className: "h-5 w-5" }), e[20] = O) : O = e[20];
67
+ let k = _ === "secrets", A;
68
+ e[21] === v ? A = e[22] : (A = () => v("secrets"), e[21] = v, e[22] = A);
69
+ let j;
70
+ e[23] !== k || e[24] !== A ? (j = /* @__PURE__ */ jsx(IconButton, {
71
+ icon: O,
72
+ label: "Secrets",
73
+ active: k,
74
+ onClick: A
75
+ }), e[23] = k, e[24] = A, e[25] = j) : j = e[25];
76
+ let M;
77
+ return e[26] !== x || e[27] !== S || e[28] !== j || e[29] !== E || e[30] !== D ? (M = /* @__PURE__ */ jsxs("div", {
60
78
  className: "border-l bg-background flex w-12 shrink-0 flex-col items-center gap-1 py-2",
61
79
  children: [
62
- v,
63
- y,
64
- C
80
+ x,
81
+ S,
82
+ E,
83
+ D,
84
+ j
65
85
  ]
66
- }), e[16] = v, e[17] = y, e[18] = C, e[19] = w) : w = e[19], w;
86
+ }), e[26] = x, e[27] = S, e[28] = j, e[29] = E, e[30] = D, e[31] = M) : M = e[31], M;
67
87
  }
68
88
  export { WorkbenchIconSidebar };
@@ -0,0 +1,182 @@
1
+ import { Button } from "../../../components/ui/button.js";
2
+ import { Input } from "../../../components/ui/input.js";
3
+ import { Label } from "../../../components/ui/label.js";
4
+ import { useCreateSecret, useDeleteSecret, useUpdateSecret, useWorkspaceSecrets } from "../../../hooks/useSecrets.js";
5
+ import { useWorkbenchLayout } from "../providers/WorkbenchLayoutProvider.js";
6
+ import { c } from "react/compiler-runtime";
7
+ import { useState } from "react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ import { KeyRound, Loader2, Plus, Trash2 } from "lucide-react";
10
+ function WorkbenchSecretsPanel() {
11
+ let _ = c(46), { pipeline: v } = useWorkbenchLayout(), y = v?.workspaceId, { data: b, isLoading: x } = useWorkspaceSecrets(y), S = useCreateSecret(), C = useUpdateSecret(), w = useDeleteSecret(), [T, E] = useState(""), [D, O] = useState(""), [k, A] = useState(null), [j, M] = useState(""), N;
12
+ _[0] !== S || _[1] !== T || _[2] !== D || _[3] !== y ? (N = async () => {
13
+ !y || !T.trim() || !D.trim() || (await S.mutateAsync({
14
+ workspaceId: y,
15
+ key: T.trim(),
16
+ value: D
17
+ }), E(""), O(""));
18
+ }, _[0] = S, _[1] = T, _[2] = D, _[3] = y, _[4] = N) : N = _[4];
19
+ let P = N, F;
20
+ _[5] !== j || _[6] !== C || _[7] !== y ? (F = async (n) => {
21
+ !y || !j || (await C.mutateAsync({
22
+ workspaceId: y,
23
+ id: n,
24
+ value: j
25
+ }), A(null), M(""));
26
+ }, _[5] = j, _[6] = C, _[7] = y, _[8] = F) : F = _[8];
27
+ let I = F, L;
28
+ _[9] !== w || _[10] !== y ? (L = async (n) => {
29
+ y && await w.mutateAsync({
30
+ workspaceId: y,
31
+ id: n
32
+ });
33
+ }, _[9] = w, _[10] = y, _[11] = L) : L = _[11];
34
+ let R = L, z;
35
+ _[12] === Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ jsxs("div", {
36
+ className: "border-b px-4 py-3",
37
+ children: [/* @__PURE__ */ jsxs("div", {
38
+ className: "flex items-center gap-2",
39
+ children: [/* @__PURE__ */ jsx(KeyRound, { className: "h-4 w-4" }), /* @__PURE__ */ jsx("h3", {
40
+ className: "text-sm font-medium",
41
+ children: "Secrets"
42
+ })]
43
+ }), /* @__PURE__ */ jsx("p", {
44
+ className: "text-muted-foreground mt-1 text-xs",
45
+ children: "Manage environment variables for this workspace."
46
+ })]
47
+ }), _[12] = z) : z = _[12];
48
+ let B;
49
+ _[13] !== j || _[14] !== k || _[15] !== R || _[16] !== I || _[17] !== x || _[18] !== b ? (B = /* @__PURE__ */ jsx("div", {
50
+ className: "flex-1 overflow-y-auto px-4 py-3",
51
+ children: x ? /* @__PURE__ */ jsxs("div", {
52
+ className: "flex items-center gap-2 py-4",
53
+ children: [/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), /* @__PURE__ */ jsx("span", {
54
+ className: "text-muted-foreground text-sm",
55
+ children: "Loading..."
56
+ })]
57
+ }) : /* @__PURE__ */ jsxs("div", {
58
+ className: "space-y-2",
59
+ children: [b?.map((g) => /* @__PURE__ */ jsxs("div", {
60
+ className: "bg-muted/50 flex items-center gap-2 rounded-md px-3 py-2",
61
+ children: [/* @__PURE__ */ jsxs("div", {
62
+ className: "flex-1",
63
+ children: [/* @__PURE__ */ jsx("div", {
64
+ className: "font-mono text-sm",
65
+ children: g.key
66
+ }), /* @__PURE__ */ jsx("div", {
67
+ className: "text-muted-foreground text-xs",
68
+ children: g.hasValue ? "Value set" : "No value"
69
+ })]
70
+ }), k === g.id ? /* @__PURE__ */ jsxs("div", {
71
+ className: "flex items-center gap-1",
72
+ children: [
73
+ /* @__PURE__ */ jsx(Input, {
74
+ type: "password",
75
+ value: j,
76
+ onChange: (n) => M(n.target.value),
77
+ placeholder: "New value",
78
+ className: "h-7 w-32 text-xs"
79
+ }),
80
+ /* @__PURE__ */ jsx(Button, {
81
+ size: "sm",
82
+ variant: "outline",
83
+ className: "h-7 text-xs",
84
+ onClick: () => void I(g.id),
85
+ children: "Save"
86
+ }),
87
+ /* @__PURE__ */ jsx(Button, {
88
+ size: "sm",
89
+ variant: "ghost",
90
+ className: "h-7 text-xs",
91
+ onClick: () => {
92
+ A(null), M("");
93
+ },
94
+ children: "Cancel"
95
+ })
96
+ ]
97
+ }) : /* @__PURE__ */ jsxs("div", {
98
+ className: "flex items-center gap-1",
99
+ children: [/* @__PURE__ */ jsx(Button, {
100
+ size: "sm",
101
+ variant: "ghost",
102
+ className: "h-7 text-xs",
103
+ onClick: () => {
104
+ A(g.id), M("");
105
+ },
106
+ children: "Update"
107
+ }), /* @__PURE__ */ jsx(Button, {
108
+ size: "sm",
109
+ variant: "ghost",
110
+ className: "h-7",
111
+ onClick: () => void R(g.id),
112
+ children: /* @__PURE__ */ jsx(Trash2, { className: "h-3 w-3" })
113
+ })]
114
+ })]
115
+ }, g.id)), b?.length === 0 && /* @__PURE__ */ jsx("p", {
116
+ className: "text-muted-foreground py-4 text-center text-sm",
117
+ children: "No secrets yet."
118
+ })]
119
+ })
120
+ }), _[13] = j, _[14] = k, _[15] = R, _[16] = I, _[17] = x, _[18] = b, _[19] = B) : B = _[19];
121
+ let V;
122
+ _[20] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ jsx(Label, {
123
+ className: "text-xs",
124
+ children: "Add Secret"
125
+ }), _[20] = V) : V = _[20];
126
+ let H;
127
+ _[21] === Symbol.for("react.memo_cache_sentinel") ? (H = (n) => E(n.target.value), _[21] = H) : H = _[21];
128
+ let U;
129
+ _[22] === T ? U = _[23] : (U = /* @__PURE__ */ jsx(Input, {
130
+ value: T,
131
+ onChange: H,
132
+ placeholder: "KEY_NAME",
133
+ className: "font-mono text-sm"
134
+ }), _[22] = T, _[23] = U);
135
+ let W;
136
+ _[24] === Symbol.for("react.memo_cache_sentinel") ? (W = (n) => O(n.target.value), _[24] = W) : W = _[24];
137
+ let G;
138
+ _[25] === D ? G = _[26] : (G = /* @__PURE__ */ jsx(Input, {
139
+ type: "password",
140
+ value: D,
141
+ onChange: W,
142
+ placeholder: "Value",
143
+ className: "text-sm"
144
+ }), _[25] = D, _[26] = G);
145
+ let K;
146
+ _[27] !== S.isPending || _[28] !== T || _[29] !== D ? (K = !T.trim() || !D.trim() || S.isPending, _[27] = S.isPending, _[28] = T, _[29] = D, _[30] = K) : K = _[30];
147
+ let q;
148
+ _[31] === P ? q = _[32] : (q = () => void P(), _[31] = P, _[32] = q);
149
+ let J;
150
+ _[33] === S.isPending ? J = _[34] : (J = S.isPending ? /* @__PURE__ */ jsx(Loader2, { className: "mr-1 h-3 w-3 animate-spin" }) : /* @__PURE__ */ jsx(Plus, { className: "mr-1 h-3 w-3" }), _[33] = S.isPending, _[34] = J);
151
+ let Y;
152
+ _[35] !== K || _[36] !== q || _[37] !== J ? (Y = /* @__PURE__ */ jsxs(Button, {
153
+ size: "sm",
154
+ className: "w-full",
155
+ disabled: K,
156
+ onClick: q,
157
+ children: [J, "Add Secret"]
158
+ }), _[35] = K, _[36] = q, _[37] = J, _[38] = Y) : Y = _[38];
159
+ let X;
160
+ _[39] !== Y || _[40] !== U || _[41] !== G ? (X = /* @__PURE__ */ jsx("div", {
161
+ className: "border-t px-4 py-3",
162
+ children: /* @__PURE__ */ jsxs("div", {
163
+ className: "space-y-2",
164
+ children: [
165
+ V,
166
+ U,
167
+ G,
168
+ Y
169
+ ]
170
+ })
171
+ }), _[39] = Y, _[40] = U, _[41] = G, _[42] = X) : X = _[42];
172
+ let Z;
173
+ return _[43] !== X || _[44] !== B ? (Z = /* @__PURE__ */ jsxs("div", {
174
+ className: "flex h-full flex-col",
175
+ children: [
176
+ z,
177
+ B,
178
+ X
179
+ ]
180
+ }), _[43] = X, _[44] = B, _[45] = Z) : Z = _[45], Z;
181
+ }
182
+ export { WorkbenchSecretsPanel };
@@ -1,12 +1,12 @@
1
- import { require_enums } from "../../../packages/contracts/dist/enums/index.js";
2
1
  import { useRunPipeline } from "../../../hooks/useProcessor.js";
3
- import { useWorkflow } from "../../../hooks/useWorkflows.js";
2
+ import { require_enums } from "../../../packages/contracts/dist/enums/index.js";
4
3
  import { useFilterDocuments } from "../../../hooks/useDocuments.js";
4
+ import { useWorkflow } from "../../../hooks/useWorkflows.js";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { useCallback, useMemo } from "react";
7
7
  var import_enums = require_enums();
8
- function useWorkflowData(e) {
9
- let o = c(22), { workflowId: s, showFullMessageHistory: l } = e, u = useWorkflow(s), d = useFilterDocuments(s), f = useRunPipeline(), p;
8
+ function useWorkflowData(r) {
9
+ let o = c(22), { workflowId: s, showFullMessageHistory: l } = r, u = useWorkflow(s), d = useFilterDocuments(s), f = useRunPipeline(), p;
10
10
  o[0] !== u.data?.place || o[1] !== l ? (p = (e) => {
11
11
  let r = e.meta, i = e.ui, a = r?.hidden || i?.hidden || !!r?.hideAtPlaces?.includes(u.data?.place ?? "");
12
12
  return !l && e.tags?.includes("internal") && (a = !0), !a;
@@ -0,0 +1,160 @@
1
+ import { c } from "react/compiler-runtime";
2
+ import { createContext, useCallback, useContext, useMemo, useState } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { useQuery, useQueryClient } from "@tanstack/react-query";
5
+ function getBaseUrl() {
6
+ return "http://localhost:8000";
7
+ }
8
+ async function refreshToken() {
9
+ return (await fetch(`${getBaseUrl()}/api/v1/auth/refresh`, {
10
+ method: "POST",
11
+ credentials: "include"
12
+ })).ok;
13
+ }
14
+ async function fetchWithRefresh(e, l) {
15
+ let u = await fetch(e, l);
16
+ return (u.status === 401 || u.status === 403) && await refreshToken() ? fetch(e, l) : u;
17
+ }
18
+ var RemoteFileExplorerContext = createContext(null);
19
+ function RemoteFileExplorerProvider(l) {
20
+ let u = c(45), { children: d } = l, f = useQueryClient(), p;
21
+ u[0] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ new Set(), u[0] = p) : p = u[0];
22
+ let [m, h] = useState(p), g;
23
+ u[1] === Symbol.for("react.memo_cache_sentinel") ? (g = [], u[1] = g) : g = u[1];
24
+ let [_, v] = useState(g), [y, b] = useState(null), x;
25
+ u[2] === Symbol.for("react.memo_cache_sentinel") ? (x = {
26
+ queryKey: ["remote-agent-file-tree"],
27
+ queryFn: _temp,
28
+ staleTime: 3e4,
29
+ retry: !1
30
+ }, u[2] = x) : x = u[2];
31
+ let S = useQuery(x), C = y?.path, w;
32
+ u[3] === C ? w = u[4] : (w = ["remote-agent-file-content", C], u[3] = C, u[4] = w);
33
+ let T;
34
+ u[5] === y ? T = u[6] : (T = async () => {
35
+ let e = getBaseUrl(), l = new URL(`${e}/api/v1/files/read`);
36
+ l.searchParams.set("path", y.path);
37
+ let u = await fetchWithRefresh(l.toString(), { credentials: "include" });
38
+ if (!u.ok) {
39
+ let e = await u.text();
40
+ throw Error(`Failed to read file (${u.status}): ${e}`);
41
+ }
42
+ return (await u.json()).content;
43
+ }, u[5] = y, u[6] = T);
44
+ let E = !!y && y.type === "file", D;
45
+ u[7] !== w || u[8] !== T || u[9] !== E ? (D = {
46
+ queryKey: w,
47
+ queryFn: T,
48
+ enabled: E,
49
+ staleTime: 15e3,
50
+ retry: !1
51
+ }, u[7] = w, u[8] = T, u[9] = E, u[10] = D) : D = u[10];
52
+ let O = useQuery(D), k;
53
+ u[11] === Symbol.for("react.memo_cache_sentinel") ? (k = (e) => {
54
+ h((l) => {
55
+ let u = new Set(l);
56
+ return u.has(e) ? u.delete(e) : u.add(e), u;
57
+ });
58
+ }, u[11] = k) : k = u[11];
59
+ let A = k, j;
60
+ u[12] === Symbol.for("react.memo_cache_sentinel") ? (j = (e) => {
61
+ e.type === "file" && (b(e), v((l) => l.some((l) => l.path === e.path) ? l : [...l, e]));
62
+ }, u[12] = j) : j = u[12];
63
+ let M = j, N;
64
+ u[13] === y?.path ? N = u[14] : (N = (e) => {
65
+ v((l) => {
66
+ let u = l.filter((l) => l.path !== e.path);
67
+ if (y?.path === e.path) if (u.length > 0) {
68
+ let d = l.findIndex((l) => l.path === e.path);
69
+ b(u[Math.max(0, d - 1)]);
70
+ } else b(null);
71
+ return u;
72
+ });
73
+ }, u[13] = y?.path, u[14] = N);
74
+ let P = N, F;
75
+ u[15] === y ? F = u[16] : (F = () => {
76
+ y && v((e) => {
77
+ let l = e.filter((e) => e.path !== y.path);
78
+ if (l.length > 0) {
79
+ let u = e.findIndex((e) => e.path === y.path);
80
+ b(l[Math.max(0, u - 1)]);
81
+ } else b(null);
82
+ return l;
83
+ });
84
+ }, u[15] = y, u[16] = F);
85
+ let I = F, L;
86
+ u[17] === Symbol.for("react.memo_cache_sentinel") ? (L = () => {
87
+ v([]), b(null);
88
+ }, u[17] = L) : L = u[17];
89
+ let R = L, z;
90
+ u[18] === Symbol.for("react.memo_cache_sentinel") ? (z = (e) => {
91
+ v([e]), b(e);
92
+ }, u[18] = z) : z = u[18];
93
+ let B = z, V;
94
+ u[19] === y ? V = u[20] : (V = (e) => {
95
+ v((l) => {
96
+ let u = l.findIndex((l) => l.path === e.path);
97
+ if (u <= 0) return l;
98
+ let d = l.slice(u);
99
+ return y && l.findIndex((e) => e.path === y.path) < u && b(e), d;
100
+ });
101
+ }, u[19] = y, u[20] = V);
102
+ let H = V, U;
103
+ u[21] === y ? U = u[22] : (U = (e) => {
104
+ v((l) => {
105
+ let u = l.findIndex((l) => l.path === e.path);
106
+ if (u < 0 || u >= l.length - 1) return l;
107
+ let d = l.slice(0, u + 1);
108
+ return y && l.findIndex((e) => e.path === y.path) > u && b(e), d;
109
+ });
110
+ }, u[21] = y, u[22] = U);
111
+ let W = U, G;
112
+ u[23] === f ? G = u[24] : (G = () => {
113
+ f.invalidateQueries({ queryKey: ["remote-agent-file-tree"] });
114
+ }, u[23] = f, u[24] = G);
115
+ let K = G, q;
116
+ u[25] === S.data ? q = u[26] : (q = S.data ?? [], u[25] = S.data, u[26] = q);
117
+ let J = S.isLoading && !S.data, Y = O.data ?? null, X = O.isLoading && !!y, Z;
118
+ u[27] !== I || u[28] !== P || u[29] !== H || u[30] !== W || u[31] !== m || u[32] !== _ || u[33] !== K || u[34] !== y || u[35] !== q || u[36] !== J || u[37] !== Y || u[38] !== X || u[39] !== S.error || u[40] !== S.isFetching ? (Z = {
119
+ nodes: q,
120
+ isTreeLoading: J,
121
+ treeError: S.error,
122
+ openFiles: _,
123
+ selectedFile: y,
124
+ fileContent: Y,
125
+ isContentLoading: X,
126
+ expandedFolders: m,
127
+ toggleFolder: A,
128
+ selectFile: M,
129
+ closeFile: P,
130
+ closeAll: R,
131
+ closeOthers: B,
132
+ closeToLeft: H,
133
+ closeToRight: W,
134
+ clearSelection: I,
135
+ refreshTree: K,
136
+ isFetchingTree: S.isFetching
137
+ }, u[27] = I, u[28] = P, u[29] = H, u[30] = W, u[31] = m, u[32] = _, u[33] = K, u[34] = y, u[35] = q, u[36] = J, u[37] = Y, u[38] = X, u[39] = S.error, u[40] = S.isFetching, u[41] = Z) : Z = u[41];
138
+ let Q = Z, $;
139
+ return u[42] !== d || u[43] !== Q ? ($ = /* @__PURE__ */ jsx(RemoteFileExplorerContext.Provider, {
140
+ value: Q,
141
+ children: d
142
+ }), u[42] = d, u[43] = Q, u[44] = $) : $ = u[44], $;
143
+ }
144
+ async function _temp() {
145
+ let e = await fetchWithRefresh(`${getBaseUrl()}/api/v1/files/tree?path=./src`, { credentials: "include" });
146
+ if (!e.ok) {
147
+ let l = await e.text();
148
+ throw Error(`Failed to load file tree (${e.status}): ${l}`);
149
+ }
150
+ return await e.json();
151
+ }
152
+ function useRemoteFileExplorer() {
153
+ let e = useContext(RemoteFileExplorerContext);
154
+ if (!e) throw Error("useRemoteFileExplorer must be used within RemoteFileExplorerProvider");
155
+ return e;
156
+ }
157
+ function useOptionalRemoteFileExplorer() {
158
+ return useContext(RemoteFileExplorerContext);
159
+ }
160
+ export { RemoteFileExplorerProvider, useOptionalRemoteFileExplorer, useRemoteFileExplorer };
@@ -3,74 +3,77 @@ import { createContext, useCallback, useContext, useMemo, useState } from "react
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  var WorkbenchLayoutContext = createContext(null);
5
5
  function WorkbenchLayoutProvider(a) {
6
- let o = c(39), { children: s, pipeline: l, isDeveloperMode: u, workspaceConfig: d, getPreviewUrl: f, getEnvironmentPreviewUrl: p, environments: m, previewPanelOpen: h, onPreviewPanelOpenChange: g } = a, _ = u === void 0 ? !1 : u, [v, y] = useState(null), [b, x] = useState(null), [S, C] = useState("preview"), [w, T] = useState(null), [E, D] = useState(""), O = h !== void 0, k = O ? h ? b ?? "preview" : null : b, A = d?.features?.previewPanel?.enabled ?? !1, j;
6
+ let o = c(44), { children: s, pipeline: l, isDeveloperMode: u, workspaceConfig: d, getPreviewUrl: f, getEnvironmentPreviewUrl: p, environments: m, previewPanelOpen: h, onPreviewPanelOpenChange: g } = a, _ = u === void 0 ? !1 : u, [v, y] = useState(null), [b, x] = useState(null), [S, C] = useState("preview"), [w, T] = useState(null), [E, D] = useState(""), O = h !== void 0, k = O ? h ? b ?? "preview" : null : b, A = d?.features?.previewPanel?.enabled ?? !1, j;
7
7
  o[0] === m ? j = o[1] : (j = m === void 0 || m.some(_temp), o[0] = m, o[1] = j);
8
- let M = A && j, N = k !== null, P;
9
- o[2] !== O || o[3] !== g ? (P = (t) => {
10
- O && g?.(t !== null), x(t);
11
- }, o[2] = O, o[3] = g, o[4] = P) : P = o[4];
12
- let F = P, I;
13
- o[5] === F ? I = o[6] : (I = (t) => {
14
- y((a) => a === t ? null : t), F(null);
15
- }, o[5] = F, o[6] = I);
8
+ let M = A && j, N;
9
+ o[2] !== m?.[0]?.slotId || o[3] !== d?.features?.fileExplorer?.enabled || o[4] !== d?.features?.fileExplorer?.environments ? (N = d?.features?.fileExplorer?.enabled && d?.features?.fileExplorer?.environments?.includes(m?.[0]?.slotId ?? ""), o[2] = m?.[0]?.slotId, o[3] = d?.features?.fileExplorer?.enabled, o[4] = d?.features?.fileExplorer?.environments, o[5] = N) : N = o[5];
10
+ let P = N, F = k !== null, I;
11
+ o[6] !== O || o[7] !== g ? (I = (e) => {
12
+ O && g?.(e !== null), x(e);
13
+ }, o[6] = O, o[7] = g, o[8] = I) : I = o[8];
16
14
  let L = I, R;
17
- o[7] === Symbol.for("react.memo_cache_sentinel") ? (R = () => {
18
- y(null);
19
- }, o[7] = R) : R = o[7];
15
+ o[9] === L ? R = o[10] : (R = (e) => {
16
+ y((a) => a === e ? null : e), L(null);
17
+ }, o[9] = L, o[10] = R);
20
18
  let z = R, B;
21
- o[8] !== k || o[9] !== F ? (B = (t) => {
22
- let a = k === t ? null : t;
23
- F(a), a && y(null);
24
- }, o[8] = k, o[9] = F, o[10] = B) : B = o[10];
19
+ o[11] === Symbol.for("react.memo_cache_sentinel") ? (B = () => {
20
+ y(null);
21
+ }, o[11] = B) : B = o[11];
25
22
  let V = B, H;
26
- o[11] === F ? H = o[12] : (H = () => {
27
- F(null);
28
- }, o[11] = F, o[12] = H);
23
+ o[12] !== k || o[13] !== L ? (H = (e) => {
24
+ let a = k === e ? null : e;
25
+ L(a), a && y(null);
26
+ }, o[12] = k, o[13] = L, o[14] = H) : H = o[14];
29
27
  let U = H, W;
30
- o[13] === F ? W = o[14] : (W = (t) => {
31
- D(t), F("preview"), y(null);
32
- }, o[13] = F, o[14] = W);
28
+ o[15] === L ? W = o[16] : (W = () => {
29
+ L(null);
30
+ }, o[15] = L, o[16] = W);
33
31
  let G = W, K;
34
- o[15] === V ? K = o[16] : (K = () => {
35
- V("preview");
36
- }, o[15] = V, o[16] = K);
32
+ o[17] === L ? K = o[18] : (K = (e) => {
33
+ D(e), L("preview"), y(null);
34
+ }, o[17] = L, o[18] = K);
37
35
  let q = K, J;
38
- o[17] !== v || o[18] !== S || o[19] !== w || o[20] !== k || o[21] !== U || o[22] !== m || o[23] !== p || o[24] !== f || o[25] !== _ || o[26] !== G || o[27] !== l || o[28] !== M || o[29] !== N || o[30] !== E || o[31] !== L || o[32] !== q || o[33] !== V || o[34] !== d ? (J = {
36
+ o[19] === U ? J = o[20] : (J = () => {
37
+ U("preview");
38
+ }, o[19] = U, o[20] = J);
39
+ let Y = J, X = P ?? !1, Z;
40
+ o[21] !== v || o[22] !== S || o[23] !== w || o[24] !== k || o[25] !== G || o[26] !== m || o[27] !== p || o[28] !== f || o[29] !== _ || o[30] !== q || o[31] !== l || o[32] !== M || o[33] !== F || o[34] !== E || o[35] !== X || o[36] !== z || o[37] !== Y || o[38] !== U || o[39] !== d ? (Z = {
39
41
  pipeline: l,
40
42
  previewPanelEnabled: M,
43
+ fileExplorerEnabled: X,
41
44
  isDeveloperMode: _,
42
45
  workspaceConfig: d,
43
46
  getPreviewUrl: f,
44
47
  getEnvironmentPreviewUrl: p,
45
48
  environments: m,
46
49
  activeFloatingPanel: v,
47
- toggleFloatingPanel: L,
48
- closeFloatingPanel: z,
50
+ toggleFloatingPanel: z,
51
+ closeFloatingPanel: V,
49
52
  activeSidePanel: k,
50
- toggleSidePanel: V,
51
- closeSidePanel: U,
53
+ toggleSidePanel: U,
54
+ closeSidePanel: G,
52
55
  selectedSlotId: E,
53
56
  setSelectedSlotId: D,
54
- openPreviewWithEnvironment: G,
55
- previewPanelOpen: N,
56
- togglePreviewPanel: q,
57
+ openPreviewWithEnvironment: q,
58
+ previewPanelOpen: F,
59
+ togglePreviewPanel: Y,
57
60
  activePreviewTab: S,
58
61
  setActivePreviewTab: C,
59
62
  activeSectionId: w,
60
63
  setActiveSectionId: T
61
- }, o[17] = v, o[18] = S, o[19] = w, o[20] = k, o[21] = U, o[22] = m, o[23] = p, o[24] = f, o[25] = _, o[26] = G, o[27] = l, o[28] = M, o[29] = N, o[30] = E, o[31] = L, o[32] = q, o[33] = V, o[34] = d, o[35] = J) : J = o[35];
62
- let Y = J, X;
63
- return o[36] !== s || o[37] !== Y ? (X = /* @__PURE__ */ jsx(WorkbenchLayoutContext.Provider, {
64
- value: Y,
64
+ }, o[21] = v, o[22] = S, o[23] = w, o[24] = k, o[25] = G, o[26] = m, o[27] = p, o[28] = f, o[29] = _, o[30] = q, o[31] = l, o[32] = M, o[33] = F, o[34] = E, o[35] = X, o[36] = z, o[37] = Y, o[38] = U, o[39] = d, o[40] = Z) : Z = o[40];
65
+ let Q = Z, $;
66
+ return o[41] !== s || o[42] !== Q ? ($ = /* @__PURE__ */ jsx(WorkbenchLayoutContext.Provider, {
67
+ value: Q,
65
68
  children: s
66
- }), o[36] = s, o[37] = Y, o[38] = X) : X = o[38], X;
69
+ }), o[41] = s, o[42] = Q, o[43] = $) : $ = o[43], $;
67
70
  }
68
- function _temp(t) {
69
- return !!t.connectionUrl && (!!t.workerId || t.local);
71
+ function _temp(e) {
72
+ return !!e.connectionUrl && (!!e.workerId || e.local);
70
73
  }
71
74
  function useWorkbenchLayout() {
72
- let t = useContext(WorkbenchLayoutContext);
73
- if (!t) throw Error("useWorkbenchLayout must be used within a WorkbenchLayoutProvider");
74
- return t;
75
+ let e = useContext(WorkbenchLayoutContext);
76
+ if (!e) throw Error("useWorkbenchLayout must be used within a WorkbenchLayoutProvider");
77
+ return e;
75
78
  }
76
79
  export { WorkbenchLayoutProvider, useWorkbenchLayout };
@@ -2,9 +2,9 @@ import { useStudio } from "../../../providers/StudioProvider.js";
2
2
  import { usePipelineConfig } from "../../../hooks/useConfig.js";
3
3
  import { useCreatePipeline } from "../../../hooks/usePipelines.js";
4
4
  import ErrorSnackbar_default from "../../../components/feedback/ErrorSnackbar.js";
5
+ import { useRunPipeline } from "../../../hooks/useProcessor.js";
5
6
  import ArgumentsView_default from "./pipeline-form/ArgumentsView.js";
6
7
  import SelectionView_default from "./pipeline-form/SelectionView.js";
7
- import { useRunPipeline } from "../../../hooks/useProcessor.js";
8
8
  import { c } from "react/compiler-runtime";
9
9
  import { useEffect, useMemo, useState } from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";