@loopstack/loopstack-studio 0.33.0 → 0.34.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 (33) hide show
  1. package/dist/api/index.js +4 -1
  2. package/dist/app/EnvironmentEmbedRoot.js +22 -24
  3. package/dist/components/messages/CompletionMessagePaper.js +25 -29
  4. package/dist/events/sse-client-events.js +2 -0
  5. package/dist/features/dashboard/AppLauncher.js +111 -64
  6. package/dist/features/documents/DocumentRenderer.js +42 -42
  7. package/dist/features/feature-registry/FeatureRegistryProvider.js +15 -17
  8. package/dist/features/feature-registry/available-features.js +3 -2
  9. package/dist/features/feature-registry/index.js +1 -1
  10. package/dist/features/file-explorer/api/files.js +8 -3
  11. package/dist/features/file-explorer/components/FileExplorerPanel.js +64 -43
  12. package/dist/features/file-explorer/file-explorer-feature.js +15 -7
  13. package/dist/features/file-explorer/hooks/useFileExplorer.js +31 -29
  14. package/dist/features/file-explorer/index.js +1 -1
  15. package/dist/features/file-explorer/providers/FileExplorerProvider.js +77 -77
  16. package/dist/features/git/components/WorkbenchGitPanel.js +1 -1
  17. package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
  18. package/dist/features/workbench/Workbench.js +16 -16
  19. package/dist/features/workbench/components/NewRunDialog.js +1 -1
  20. package/dist/features/workbench/components/WorkbenchIconSidebar.js +1 -1
  21. package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
  22. package/dist/features/workbench/index.js +1 -1
  23. package/dist/features/workspaces/Workspaces.js +1 -1
  24. package/dist/hooks/useSecrets.js +9 -45
  25. package/dist/index.d.ts +27 -13
  26. package/dist/index.js +6 -6
  27. package/dist/loopstack-studio.css +1 -1
  28. package/dist/pages/EmbedWorkbenchPage.js +46 -40
  29. package/dist/pages/WorkbenchPage.js +50 -45
  30. package/dist/pages/WorkspacePage.js +39 -25
  31. package/dist/pages/WorkspaceRunsPage.js +34 -26
  32. package/dist/providers/InvalidationEventsProvider.js +22 -20
  33. package/package.json +2 -2
package/dist/api/index.js CHANGED
@@ -17,7 +17,10 @@ function createApi(f) {
17
17
  dashboard: createDashboardApi(f),
18
18
  documents: createDocumentsApi(f),
19
19
  environments: createEnvironmentsApi(f),
20
- files: createFilesApi(f),
20
+ files: {
21
+ local: createFilesApi(f, "local"),
22
+ remote: createFilesApi(f, "remote")
23
+ },
21
24
  git: createGitApi(f),
22
25
  processor: createProcessorApi(f),
23
26
  secrets: createSecretsApi(f),
@@ -2,36 +2,34 @@ import { StudioProvider } from "../providers/StudioProvider.js";
2
2
  import { SseProvider } from "../providers/SseProvider.js";
3
3
  import { InvalidationEventsProvider } from "../providers/InvalidationEventsProvider.js";
4
4
  import { useRouter } from "../routing/LocalRouter.js";
5
- import { FeatureRegistryProvider } from "../features/feature-registry/FeatureRegistryProvider.js";
6
- import "../features/feature-registry/index.js";
7
5
  import LocalHealthCheck_default from "../features/health/LocalHealthCheck.js";
8
6
  import { QueryProvider } from "../providers/QueryProvider.js";
9
7
  import { c } from "react/compiler-runtime";
10
8
  import { jsx, jsxs } from "react/jsx-runtime";
11
9
  import { Outlet, useSearchParams } from "react-router-dom";
12
10
  function EnvironmentEmbedRoot() {
13
- let p = c(11), [m] = useSearchParams(), h;
14
- p[0] === m ? h = p[1] : (h = m.get("url") ?? "http://localhost:3080", p[0] = m, p[1] = h);
15
- let g = h, _;
16
- p[2] === m ? _ = p[3] : (_ = m.get("name") ?? "Preview Environment", p[2] = m, p[3] = _);
17
- let v = _, y;
18
- p[4] !== v || p[5] !== g ? (y = {
11
+ let f = c(14), [p] = useSearchParams(), m;
12
+ f[0] === p ? m = f[1] : (m = p.get("url") ?? "http://localhost:3080", f[0] = p, f[1] = m);
13
+ let h = m, g;
14
+ f[2] === p ? g = f[3] : (g = p.get("name") ?? "Preview Environment", f[2] = p, f[3] = g);
15
+ let _ = g, v;
16
+ f[4] !== _ || f[5] !== h ? (v = {
19
17
  id: "preview-env",
20
- name: v,
21
- url: g
22
- }, p[4] = v, p[5] = g, p[6] = y) : y = p[6];
23
- let b = y, x = useRouter(b.id, "/embed/env"), S;
24
- p[7] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ jsxs(FeatureRegistryProvider, { children: [
25
- /* @__PURE__ */ jsx(LocalHealthCheck_default, {}),
26
- /* @__PURE__ */ jsx(SseProvider, {}),
27
- /* @__PURE__ */ jsx(InvalidationEventsProvider, {}),
28
- /* @__PURE__ */ jsx(Outlet, {})
29
- ] }), p[7] = S) : S = p[7];
30
- let C;
31
- return p[8] !== b || p[9] !== x ? (C = /* @__PURE__ */ jsx(QueryProvider, { children: /* @__PURE__ */ jsx(StudioProvider, {
32
- router: x,
33
- environment: b,
34
- children: S
35
- }) }), p[8] = b, p[9] = x, p[10] = C) : C = p[10], C;
18
+ name: _,
19
+ url: h
20
+ }, f[4] = _, f[5] = h, f[6] = v) : v = f[6];
21
+ let y = v, b = useRouter(y.id, "/embed/env"), x, S, C, w;
22
+ f[7] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ jsx(LocalHealthCheck_default, {}), S = /* @__PURE__ */ jsx(SseProvider, {}), C = /* @__PURE__ */ jsx(InvalidationEventsProvider, {}), w = /* @__PURE__ */ jsx(Outlet, {}), f[7] = x, f[8] = S, f[9] = C, f[10] = w) : (x = f[7], S = f[8], C = f[9], w = f[10]);
23
+ let T;
24
+ return f[11] !== y || f[12] !== b ? (T = /* @__PURE__ */ jsx(QueryProvider, { children: /* @__PURE__ */ jsxs(StudioProvider, {
25
+ router: b,
26
+ environment: y,
27
+ children: [
28
+ x,
29
+ S,
30
+ C,
31
+ w
32
+ ]
33
+ }) }), f[11] = y, f[12] = b, f[13] = T) : T = f[13], T;
36
34
  }
37
35
  export { EnvironmentEmbedRoot as default };
@@ -4,7 +4,7 @@ import { c } from "react/compiler-runtime";
4
4
  import React from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  var CompletionMessagePaper_default = (s) => {
7
- let l = c(38), { role: u, children: d, timestamp: f, metadata: p, fullWidth: m, className: h } = s, g = m === void 0 ? !1 : m, _;
7
+ let l = c(33), { role: u, children: d, timestamp: f, metadata: p, fullWidth: m, className: h } = s, g = m === void 0 ? !1 : m, _;
8
8
  l[0] === Symbol.for("react.memo_cache_sentinel") ? (_ = {
9
9
  system: {
10
10
  color: "#efb108",
@@ -58,46 +58,42 @@ var CompletionMessagePaper_default = (s) => {
58
58
  }), l[15] = b, l[16] = p, l[17] = A) : A = l[17];
59
59
  let j = g ? "w-full" : "w-auto", M;
60
60
  l[18] === j ? M = l[19] : (M = cn("relative max-w-full px-6 py-4 wrap-break-word shadow-none", j), l[18] = j, l[19] = M);
61
- let N = b ? "user" : "text-foreground", P;
62
- l[20] === N ? P = l[21] : (P = cn("leading-relaxed wrap-break-word whitespace-pre-wrap", N), l[20] = N, l[21] = P);
63
- let F;
64
- l[22] === d ? F = l[23] : (F = /* @__PURE__ */ jsx("div", {
65
- className: "message-content",
66
- children: d
67
- }), l[22] = d, l[23] = F);
68
- let I;
69
- l[24] !== P || l[25] !== F ? (I = /* @__PURE__ */ jsx("div", {
70
- className: P,
71
- children: F
72
- }), l[24] = P, l[25] = F, l[26] = I) : I = l[26];
73
- let L;
74
- l[27] !== M || l[28] !== I ? (L = /* @__PURE__ */ jsx(Card, {
61
+ let N;
62
+ l[20] === d ? N = l[21] : (N = /* @__PURE__ */ jsx("div", {
63
+ className: "text-foreground leading-relaxed wrap-break-word whitespace-pre-wrap",
64
+ children: /* @__PURE__ */ jsx("div", {
65
+ className: "message-content",
66
+ children: d
67
+ })
68
+ }), l[20] = d, l[21] = N);
69
+ let P;
70
+ l[22] !== M || l[23] !== N ? (P = /* @__PURE__ */ jsx(Card, {
75
71
  className: M,
76
- children: I
77
- }), l[27] = M, l[28] = I, l[29] = L) : L = l[29];
78
- let R;
79
- l[30] !== k || l[31] !== A || l[32] !== L || l[33] !== E ? (R = /* @__PURE__ */ jsxs("div", {
72
+ children: N
73
+ }), l[22] = M, l[23] = N, l[24] = P) : P = l[24];
74
+ let F;
75
+ l[25] !== k || l[26] !== A || l[27] !== P || l[28] !== E ? (F = /* @__PURE__ */ jsxs("div", {
80
76
  className: E,
81
77
  children: [
82
78
  k,
83
79
  A,
84
- L
80
+ P
85
81
  ]
86
- }), l[30] = k, l[31] = A, l[32] = L, l[33] = E, l[34] = R) : R = l[34];
87
- let z;
88
- return l[35] !== R || l[36] !== C ? (z = /* @__PURE__ */ jsx("div", {
82
+ }), l[25] = k, l[26] = A, l[27] = P, l[28] = E, l[29] = F) : F = l[29];
83
+ let I;
84
+ return l[30] !== F || l[31] !== C ? (I = /* @__PURE__ */ jsx("div", {
89
85
  className: C,
90
- children: R
91
- }), l[35] = R, l[36] = C, l[37] = z) : z = l[37], z;
86
+ children: F
87
+ }), l[30] = F, l[31] = C, l[32] = I) : I = l[32], I;
92
88
  };
93
- function _temp(r) {
94
- return r.toLocaleTimeString([], {
89
+ function _temp(t) {
90
+ return t.toLocaleTimeString([], {
95
91
  hour: "2-digit",
96
92
  minute: "2-digit"
97
93
  });
98
94
  }
99
- function _temp2(r) {
100
- let [a, o] = r;
95
+ function _temp2(t) {
96
+ let [a, o] = t;
101
97
  return /* @__PURE__ */ jsxs("div", {
102
98
  className: "text-muted-foreground font-mono text-xs",
103
99
  children: [
@@ -2,6 +2,8 @@ const SseClientEvents = {
2
2
  WORKFLOW_CREATED: "workflow.created",
3
3
  WORKFLOW_UPDATED: "workflow.updated",
4
4
  DOCUMENT_CREATED: "document.created",
5
+ SECRET_UPSERTED: "secret.upserted",
6
+ SECRET_DELETED: "secret.deleted",
5
7
  SSE_CONNECTED: "sse.connected",
6
8
  LLM_RESPONSE_START: "llm.response.start",
7
9
  LLM_RESPONSE_TEXT_DELTA: "llm.response.text_delta",
@@ -1,84 +1,131 @@
1
1
  import { useStudio } from "../../providers/StudioProvider.js";
2
+ import { useFilterWorkspaces } from "../../hooks/useWorkspaces.js";
2
3
  import { useComponentOverrides } from "../../providers/ComponentOverridesProvider.js";
3
4
  import { Button } from "../../components/ui/button.js";
4
5
  import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../../components/ui/card.js";
5
6
  import { Dialog, DialogContent } from "../../components/ui/dialog.js";
6
7
  import CreateWorkspace_default from "../workspaces/components/CreateWorkspace.js";
8
+ import { AVAILABLE_FEATURES } from "../feature-registry/available-features.js";
7
9
  import { c } from "react/compiler-runtime";
8
10
  import { useMemo, useState } from "react";
9
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
12
  import { Link } from "react-router-dom";
11
- import { Boxes, FolderOpen, Plus } from "lucide-react";
12
- function AppLauncher(x) {
13
- let S = c(25), { apps: C } = x, { CreateWorkspace: w } = useComponentOverrides(), T = w ?? CreateWorkspace_default, { router: E } = useStudio(), [D, O] = useState(null), k;
14
- S[0] === D ? k = S[1] : (k = D ? [{
15
- appName: D.appName,
16
- title: D.title,
17
- environments: D.extensions?.environments ?? []
18
- }] : [], S[0] = D, S[1] = k);
19
- let A = k, j;
20
- S[2] === E ? j = S[3] : (j = (e) => {
21
- O(null), e && E.navigateToWorkspace(e.id);
22
- }, S[2] = E, S[3] = j);
23
- let M = j, N;
24
- if (S[4] !== C || S[5] !== E) {
13
+ import { Boxes, FolderOpen, Plus, Server } from "lucide-react";
14
+ function getCapabilityIcons(e) {
15
+ let S = [];
16
+ for (let C of e.extensions?.environments ?? []) S.push({
17
+ key: `env:${C.id}`,
18
+ Icon: Server,
19
+ label: C.title ?? C.id
20
+ });
21
+ for (let C of e.features) {
22
+ if (C.enabled === !1) continue;
23
+ let e = AVAILABLE_FEATURES[C.id];
24
+ e?.sidebarPanel && S.push({
25
+ key: `feature:${e.id}`,
26
+ Icon: e.sidebarPanel.icon,
27
+ label: e.sidebarPanel.label
28
+ });
29
+ }
30
+ return S;
31
+ }
32
+ function AppLauncher(w) {
33
+ let T = c(30), { apps: E } = w, { CreateWorkspace: D } = useComponentOverrides(), O = D ?? CreateWorkspace_default, { router: k } = useStudio(), [A, j] = useState(null), M;
34
+ T[0] === Symbol.for("react.memo_cache_sentinel") ? (M = {}, T[0] = M) : M = T[0];
35
+ let N = useFilterWorkspaces(void 0, M, "id", "DESC", 0, 1e3), P;
36
+ if (T[1] !== N.data?.data) {
37
+ P = {};
38
+ for (let e of N.data?.data ?? []) P[e.appName] = (P[e.appName] ?? 0) + 1;
39
+ T[1] = N.data?.data, T[2] = P;
40
+ } else P = T[2];
41
+ let F = P, I;
42
+ T[3] === A ? I = T[4] : (I = A ? [{
43
+ appName: A.appName,
44
+ title: A.title,
45
+ environments: A.extensions?.environments ?? []
46
+ }] : [], T[3] = A, T[4] = I);
47
+ let L = I, R;
48
+ T[5] === k ? R = T[6] : (R = (e) => {
49
+ j(null), e && k.navigateToWorkspace(e.id);
50
+ }, T[5] = k, T[6] = R);
51
+ let z = R, B;
52
+ if (T[7] !== E || T[8] !== k || T[9] !== F) {
25
53
  let e;
26
- S[7] === E ? e = S[8] : (e = (e) => /* @__PURE__ */ jsxs(Card, {
27
- className: "flex flex-col",
28
- children: [/* @__PURE__ */ jsxs(CardHeader, { children: [/* @__PURE__ */ jsxs("div", {
29
- className: "flex items-center gap-2",
30
- children: [/* @__PURE__ */ jsx(Boxes, { className: "text-muted-foreground h-5 w-5" }), /* @__PURE__ */ jsx(CardTitle, {
31
- className: "text-base",
32
- children: e.title
33
- })]
34
- }), e.description && /* @__PURE__ */ jsx(CardDescription, { children: e.description })] }), /* @__PURE__ */ jsxs(CardContent, {
35
- className: "mt-auto flex gap-2",
36
- children: [/* @__PURE__ */ jsx(Button, {
37
- variant: "ghost",
38
- size: "sm",
39
- className: "flex-1",
40
- asChild: !0,
41
- children: /* @__PURE__ */ jsxs(Link, {
42
- to: `${E.getWorkspaces()}?appName=${encodeURIComponent(e.appName)}`,
43
- children: [/* @__PURE__ */ jsx(FolderOpen, { className: "mr-1 h-4 w-4" }), "View Workspaces"]
54
+ T[11] !== k || T[12] !== F ? (e = (e) => {
55
+ let S = getCapabilityIcons(e), C = F[e.appName] ?? 0;
56
+ return /* @__PURE__ */ jsxs(Card, {
57
+ className: "flex flex-col",
58
+ children: [/* @__PURE__ */ jsxs(CardHeader, { children: [/* @__PURE__ */ jsxs("div", {
59
+ className: "flex items-start justify-between gap-2",
60
+ children: [/* @__PURE__ */ jsxs("div", {
61
+ className: "flex items-center gap-2",
62
+ children: [/* @__PURE__ */ jsx(Boxes, { className: "text-muted-foreground h-5 w-5" }), /* @__PURE__ */ jsx(CardTitle, {
63
+ className: "text-base",
64
+ children: e.title
65
+ })]
66
+ }), S.length > 0 && /* @__PURE__ */ jsx("div", {
67
+ className: "text-muted-foreground flex shrink-0 items-center gap-1",
68
+ children: S.map(_temp)
69
+ })]
70
+ }), e.description && /* @__PURE__ */ jsx(CardDescription, { children: e.description })] }), /* @__PURE__ */ jsx(CardContent, {
71
+ className: "mt-auto",
72
+ children: /* @__PURE__ */ jsx("div", {
73
+ className: "flex gap-2",
74
+ children: C > 0 ? /* @__PURE__ */ jsx(Button, {
75
+ variant: "ghost",
76
+ size: "sm",
77
+ className: "flex-1",
78
+ asChild: !0,
79
+ children: /* @__PURE__ */ jsxs(Link, {
80
+ to: `${k.getWorkspaces()}?appName=${encodeURIComponent(e.appName)}`,
81
+ children: [/* @__PURE__ */ jsx(FolderOpen, { className: "mr-1 h-4 w-4" }), "View Workspaces"]
82
+ })
83
+ }) : /* @__PURE__ */ jsxs(Button, {
84
+ variant: "outline",
85
+ size: "sm",
86
+ className: "flex-1",
87
+ onClick: () => j(e),
88
+ children: [/* @__PURE__ */ jsx(Plus, { className: "mr-1 h-4 w-4" }), "Configure"]
89
+ })
44
90
  })
45
- }), /* @__PURE__ */ jsxs(Button, {
46
- variant: "outline",
47
- size: "sm",
48
- className: "flex-1",
49
- onClick: () => O(e),
50
- children: [/* @__PURE__ */ jsx(Plus, { className: "mr-1 h-4 w-4" }), "Create Workspace"]
51
91
  })]
52
- })]
53
- }, e.appName), S[7] = E, S[8] = e), N = C.map(e), S[4] = C, S[5] = E, S[6] = N;
54
- } else N = S[6];
55
- let P;
56
- S[9] === N ? P = S[10] : (P = /* @__PURE__ */ jsx("div", {
92
+ }, e.appName);
93
+ }, T[11] = k, T[12] = F, T[13] = e) : e = T[13], B = E.map(e), T[7] = E, T[8] = k, T[9] = F, T[10] = B;
94
+ } else B = T[10];
95
+ let V;
96
+ T[14] === B ? V = T[15] : (V = /* @__PURE__ */ jsx("div", {
57
97
  className: "mb-8",
58
98
  children: /* @__PURE__ */ jsx("div", {
59
99
  className: "grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",
60
- children: N
100
+ children: B
61
101
  })
62
- }), S[9] = N, S[10] = P);
63
- let F = !!D, I;
64
- S[11] === Symbol.for("react.memo_cache_sentinel") ? (I = (e) => !e && O(null), S[11] = I) : I = S[11];
65
- let L;
66
- S[12] !== T || S[13] !== A || S[14] !== M || S[15] !== D ? (L = D && /* @__PURE__ */ jsx(T, {
67
- types: A,
68
- onSuccess: M
69
- }), S[12] = T, S[13] = A, S[14] = M, S[15] = D, S[16] = L) : L = S[16];
70
- let R;
71
- S[17] === L ? R = S[18] : (R = /* @__PURE__ */ jsx(DialogContent, {
102
+ }), T[14] = B, T[15] = V);
103
+ let H = !!A, U;
104
+ T[16] === Symbol.for("react.memo_cache_sentinel") ? (U = (e) => !e && j(null), T[16] = U) : U = T[16];
105
+ let W;
106
+ T[17] !== O || T[18] !== L || T[19] !== z || T[20] !== A ? (W = A && /* @__PURE__ */ jsx(O, {
107
+ types: L,
108
+ onSuccess: z
109
+ }), T[17] = O, T[18] = L, T[19] = z, T[20] = A, T[21] = W) : W = T[21];
110
+ let G;
111
+ T[22] === W ? G = T[23] : (G = /* @__PURE__ */ jsx(DialogContent, {
72
112
  className: "max-w-2xl",
73
- children: L
74
- }), S[17] = L, S[18] = R);
75
- let z;
76
- S[19] !== F || S[20] !== R ? (z = /* @__PURE__ */ jsx(Dialog, {
77
- open: F,
78
- onOpenChange: I,
79
- children: R
80
- }), S[19] = F, S[20] = R, S[21] = z) : z = S[21];
81
- let B;
82
- return S[22] !== P || S[23] !== z ? (B = /* @__PURE__ */ jsxs(Fragment$1, { children: [P, z] }), S[22] = P, S[23] = z, S[24] = B) : B = S[24], B;
113
+ children: W
114
+ }), T[22] = W, T[23] = G);
115
+ let K;
116
+ T[24] !== H || T[25] !== G ? (K = /* @__PURE__ */ jsx(Dialog, {
117
+ open: H,
118
+ onOpenChange: U,
119
+ children: G
120
+ }), T[24] = H, T[25] = G, T[26] = K) : K = T[26];
121
+ let q;
122
+ return T[27] !== K || T[28] !== V ? (q = /* @__PURE__ */ jsxs(Fragment$1, { children: [V, K] }), T[27] = K, T[28] = V, T[29] = q) : q = T[29], q;
123
+ }
124
+ function _temp(e) {
125
+ let { key: S, Icon: C } = e;
126
+ return /* @__PURE__ */ jsx("span", {
127
+ className: "inline-flex h-6 w-6 items-center justify-center",
128
+ children: /* @__PURE__ */ jsx(C, { className: "h-4 w-4" })
129
+ }, S);
83
130
  }
84
131
  export { AppLauncher as default };
@@ -1,5 +1,7 @@
1
1
  import { useDocumentConfigs } from "../../hooks/useConfig.js";
2
2
  import CompletionMessagePaper_default from "../../components/messages/CompletionMessagePaper.js";
3
+ import { useFeatureRegistry } from "../feature-registry/FeatureRegistryProvider.js";
4
+ import "../feature-registry/index.js";
3
5
  import OAuthPromptRenderer_default from "../oauth/OAuthPromptRenderer.js";
4
6
  import "../oauth/index.js";
5
7
  import AiMessage_default from "./renderers/AiMessage.js";
@@ -14,86 +16,84 @@ import LlmMessage_default from "./renderers/LlmMessage.js";
14
16
  import MarkdownMessageRenderer_default from "./renderers/MarkdownMessageRenderer.js";
15
17
  import PlainMessageRenderer_default from "./renderers/PlainMessageRenderer.js";
16
18
  import TextPromptRenderer_default from "./renderers/TextPromptRenderer.js";
17
- import { useFeatureRegistry } from "../feature-registry/FeatureRegistryProvider.js";
18
- import "../feature-registry/index.js";
19
19
  import { c } from "react/compiler-runtime";
20
20
  import React, { useMemo } from "react";
21
21
  import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
22
22
  var coreRendererRegistry = new Map([
23
- ["ai-message", ({ document: e, isLastItem: _ }) => /* @__PURE__ */ jsx(AiMessage_default, {
23
+ ["ai-message", ({ document: e, isLastItem: g }) => /* @__PURE__ */ jsx(AiMessage_default, {
24
24
  document: e,
25
- isLastItem: _
25
+ isLastItem: g
26
26
  })],
27
- ["llm-message", ({ document: e, isLastItem: _ }) => /* @__PURE__ */ jsx(LlmMessage_default, {
27
+ ["llm-message", ({ document: e, isLastItem: g }) => /* @__PURE__ */ jsx(LlmMessage_default, {
28
28
  document: e,
29
- isLastItem: _
29
+ isLastItem: g
30
30
  })],
31
31
  ["debug", ({ document: e }) => /* @__PURE__ */ jsx("div", {
32
32
  className: "mb-4 flex",
33
33
  children: /* @__PURE__ */ jsx(DocumentDebugRenderer_default, { document: e })
34
34
  })],
35
- ["form", ({ parentWorkflow: e, workflow: v, document: y, isActive: b }) => /* @__PURE__ */ jsx(CompletionMessagePaper_default, {
35
+ ["form", ({ parentWorkflow: e, workflow: _, document: v, isActive: y }) => /* @__PURE__ */ jsx(CompletionMessagePaper_default, {
36
36
  role: "document",
37
37
  fullWidth: !0,
38
- timestamp: new Date(y.createdAt),
38
+ timestamp: new Date(v.createdAt),
39
39
  children: /* @__PURE__ */ jsx(DocumentFormRenderer_default, {
40
40
  parentWorkflow: e,
41
- workflow: v,
42
- document: y,
43
- enabled: b,
44
- viewOnly: !b
41
+ workflow: _,
42
+ document: v,
43
+ enabled: y,
44
+ viewOnly: !y
45
45
  })
46
46
  })],
47
47
  ["message", ({ document: e }) => /* @__PURE__ */ jsx(DocumentMessageRenderer_default, { document: e })],
48
48
  ["error", ({ document: e }) => /* @__PURE__ */ jsx(ErrorMessageRenderer_default, { document: e })],
49
49
  ["plain", ({ document: e }) => /* @__PURE__ */ jsx(PlainMessageRenderer_default, { document: e })],
50
50
  ["markdown", ({ document: e }) => /* @__PURE__ */ jsx(MarkdownMessageRenderer_default, { document: e })],
51
- ["link", ({ workflow: e, document: _ }) => /* @__PURE__ */ jsx(LinkMessageRenderer_default, {
51
+ ["link", ({ workflow: e, document: g }) => /* @__PURE__ */ jsx(LinkMessageRenderer_default, {
52
52
  workflow: e,
53
- document: _
53
+ document: g
54
54
  })],
55
- ["oauth-prompt", ({ parentWorkflow: e, workflow: _, document: y, isActive: b }) => /* @__PURE__ */ jsx(OAuthPromptRenderer_default, {
55
+ ["oauth-prompt", ({ parentWorkflow: e, workflow: g, document: _, isActive: y }) => /* @__PURE__ */ jsx(OAuthPromptRenderer_default, {
56
56
  parentWorkflow: e,
57
- workflow: _,
58
- document: y,
59
- isActive: b
57
+ workflow: g,
58
+ document: _,
59
+ isActive: y
60
60
  })],
61
- ["text-prompt", ({ parentWorkflow: e, workflow: _, document: v, isActive: y }) => /* @__PURE__ */ jsx(TextPromptRenderer_default, {
61
+ ["text-prompt", ({ parentWorkflow: e, workflow: g, document: _, isActive: v }) => /* @__PURE__ */ jsx(TextPromptRenderer_default, {
62
62
  parentWorkflow: e,
63
- workflow: _,
64
- document: v,
65
- isActive: y
63
+ workflow: g,
64
+ document: _,
65
+ isActive: v
66
66
  })],
67
- ["choices", ({ parentWorkflow: e, workflow: _, document: v, isActive: y }) => /* @__PURE__ */ jsx(ChoicesRenderer_default, {
67
+ ["choices", ({ parentWorkflow: e, workflow: g, document: _, isActive: v }) => /* @__PURE__ */ jsx(ChoicesRenderer_default, {
68
68
  parentWorkflow: e,
69
- workflow: _,
70
- document: v,
71
- isActive: y
69
+ workflow: g,
70
+ document: _,
71
+ isActive: v
72
72
  })],
73
- ["confirm-prompt", ({ parentWorkflow: e, workflow: _, document: v, isActive: y }) => /* @__PURE__ */ jsx(ConfirmPromptRenderer_default, {
73
+ ["confirm-prompt", ({ parentWorkflow: e, workflow: g, document: _, isActive: v }) => /* @__PURE__ */ jsx(ConfirmPromptRenderer_default, {
74
74
  parentWorkflow: e,
75
- workflow: _,
76
- document: v,
77
- isActive: y
75
+ workflow: g,
76
+ document: _,
77
+ isActive: v
78
78
  })]
79
79
  ]);
80
80
  function resolveWidgetName(e) {
81
- let _ = e;
82
- return _?.widgets?.[0]?.widget ? _.widgets[0].widget : _?.form?.widget ? _.form.widget : "form";
81
+ let g = e;
82
+ return g?.widgets?.[0]?.widget ? g.widgets[0].widget : g?.form?.widget ? g.form.widget : "form";
83
83
  }
84
- var DocumentRenderer_default = (_) => {
85
- let v = c(9), y = useFeatureRegistry(), b = useDocumentConfigs(), x = _.document, S;
84
+ var DocumentRenderer_default = (g) => {
85
+ let v = c(9), y = useFeatureRegistry(), b = useDocumentConfigs(), x = g.document, S;
86
86
  if (v[0] !== x.documentName || v[1] !== b || v[2] !== y) {
87
- let e = resolveWidgetName(b.get(x.documentName)?.ui), _;
87
+ let e = resolveWidgetName(b.get(x.documentName)?.ui), g;
88
88
  if (v[4] !== y) {
89
- _ = /* @__PURE__ */ new Map();
90
- for (let e of y) if (e.documentRenderers) for (let [v, y] of Object.entries(e.documentRenderers)) _.set(v, y);
91
- v[4] = y, v[5] = _;
92
- } else _ = v[5];
93
- let C = _;
94
- S = coreRendererRegistry.get(e) ?? C.get(e), v[0] = x.documentName, v[1] = b, v[2] = y, v[3] = S;
89
+ g = /* @__PURE__ */ new Map();
90
+ for (let e of y) if (e.documentRenderers) for (let [_, v] of Object.entries(e.documentRenderers)) g.set(_, v);
91
+ v[4] = y, v[5] = g;
92
+ } else g = v[5];
93
+ let _ = g;
94
+ S = coreRendererRegistry.get(e) ?? _.get(e), v[0] = x.documentName, v[1] = b, v[2] = y, v[3] = S;
95
95
  } else S = v[3];
96
96
  let C = S, w;
97
- return v[6] !== C || v[7] !== _ ? (w = /* @__PURE__ */ jsx("div", { children: C ? /* @__PURE__ */ jsx(C, { ..._ }) : /* @__PURE__ */ jsx(Fragment$1, { children: "unknown document type" }) }), v[6] = C, v[7] = _, v[8] = w) : w = v[8], w;
97
+ return v[6] !== C || v[7] !== g ? (w = /* @__PURE__ */ jsx("div", { children: C ? /* @__PURE__ */ jsx(C, { ...g }) : /* @__PURE__ */ jsx(Fragment$1, { children: "unknown document type" }) }), v[6] = C, v[7] = g, v[8] = w) : w = v[8], w;
98
98
  };
99
99
  export { DocumentRenderer_default as default };
@@ -4,26 +4,24 @@ import { c } from "react/compiler-runtime";
4
4
  import { createContext, useContext, useMemo } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  var FeatureRegistryContext = createContext([]), BackendFeaturesContext = createContext([]);
7
- function resolveFeatures(e, o) {
8
- return e?.length ? e.filter((e) => e.enabled !== !1).map((e) => AVAILABLE_FEATURES[e.id]).filter(Boolean) : o;
7
+ function resolveFeatures(e) {
8
+ return e.filter((e) => e.enabled !== !1).map((e) => AVAILABLE_FEATURES[e.id]).filter(Boolean);
9
9
  }
10
10
  function FeatureRegistryProvider(a) {
11
- let s = c(13), { features: l, children: u } = a, d;
12
- s[0] === l ? d = s[1] : (d = l === void 0 ? [] : l, s[0] = l, s[1] = d);
13
- let f = d, { data: p } = useAppsConfig(), m = p?.[0]?.features, h;
14
- s[2] !== m || s[3] !== f ? (h = resolveFeatures(m, f), s[2] = m, s[3] = f, s[4] = h) : h = s[4];
15
- let g = h, _;
16
- s[5] === m ? _ = s[6] : (_ = m ?? [], s[5] = m, s[6] = _);
17
- let v = _, y;
18
- s[7] !== g || s[8] !== u ? (y = /* @__PURE__ */ jsx(FeatureRegistryContext.Provider, {
19
- value: g,
11
+ let s = c(11), { appName: l, children: u } = a, { data: d } = useAppsConfig(), f;
12
+ s[0] !== l || s[1] !== d ? (f = d?.find((e) => e.appName === l)?.features ?? [], s[0] = l, s[1] = d, s[2] = f) : f = s[2];
13
+ let p = f, m;
14
+ s[3] === p ? m = s[4] : (m = resolveFeatures(p), s[3] = p, s[4] = m);
15
+ let h = m, g;
16
+ s[5] !== h || s[6] !== u ? (g = /* @__PURE__ */ jsx(FeatureRegistryContext.Provider, {
17
+ value: h,
20
18
  children: u
21
- }), s[7] = g, s[8] = u, s[9] = y) : y = s[9];
22
- let b;
23
- return s[10] !== v || s[11] !== y ? (b = /* @__PURE__ */ jsx(BackendFeaturesContext.Provider, {
24
- value: v,
25
- children: y
26
- }), s[10] = v, s[11] = y, s[12] = b) : b = s[12], b;
19
+ }), s[5] = h, s[6] = u, s[7] = g) : g = s[7];
20
+ let _;
21
+ return s[8] !== p || s[9] !== g ? (_ = /* @__PURE__ */ jsx(BackendFeaturesContext.Provider, {
22
+ value: p,
23
+ children: g
24
+ }), s[8] = p, s[9] = g, s[10] = _) : _ = s[10], _;
27
25
  }
28
26
  function useFeatureRegistry() {
29
27
  return useContext(FeatureRegistryContext);
@@ -1,4 +1,4 @@
1
- import { fileExplorerFeature } from "../file-explorer/file-explorer-feature.js";
1
+ import { localFileExplorerFeature, remoteFileExplorerFeature } from "../file-explorer/file-explorer-feature.js";
2
2
  import "../file-explorer/index.js";
3
3
  import { gitFeature } from "../git/git-feature.js";
4
4
  import "../git/index.js";
@@ -6,7 +6,8 @@ import { secretsFeature } from "../secrets/secrets-feature.js";
6
6
  import "../secrets/index.js";
7
7
  const AVAILABLE_FEATURES = {
8
8
  git: gitFeature,
9
- fileExplorer: fileExplorerFeature,
9
+ localFileExplorer: localFileExplorerFeature,
10
+ remoteFileExplorer: remoteFileExplorerFeature,
10
11
  secrets: secretsFeature
11
12
  };
12
13
  export { AVAILABLE_FEATURES };
@@ -1,2 +1,2 @@
1
- import { AVAILABLE_FEATURES } from "./available-features.js";
2
1
  import { FeatureRegistryProvider, useFeatureConfig, useFeatureRegistry } from "./FeatureRegistryProvider.js";
2
+ import { AVAILABLE_FEATURES } from "./available-features.js";
@@ -1,7 +1,12 @@
1
- function createFilesApi(e) {
1
+ var VARIANT_BASE_PATH = {
2
+ local: "local-files",
3
+ remote: "remote-files"
4
+ };
5
+ function createFilesApi(t, n) {
6
+ let r = VARIANT_BASE_PATH[n];
2
7
  return {
3
- getTree: (t) => e.get(`/api/v1/workspaces/${t.workspaceId}/files/tree`, { params: t.path ? { path: t.path } : void 0 }).then((e) => e.data),
4
- readFile: (t) => e.get(`/api/v1/workspaces/${t.workspaceId}/files/read`, { params: { path: t.path } }).then((e) => e.data)
8
+ getTree: (e) => t.get(`/api/v1/workspaces/${e.workspaceId}/${r}/tree`, { params: e.path ? { path: e.path } : void 0 }).then((e) => e.data),
9
+ readFile: (e) => t.get(`/api/v1/workspaces/${e.workspaceId}/${r}/read`, { params: { path: e.path } }).then((e) => e.data)
5
10
  };
6
11
  }
7
12
  export { createFilesApi };