@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.
- package/dist/api/index.js +4 -1
- package/dist/app/EnvironmentEmbedRoot.js +22 -24
- package/dist/components/messages/CompletionMessagePaper.js +25 -29
- package/dist/events/sse-client-events.js +2 -0
- package/dist/features/dashboard/AppLauncher.js +111 -64
- package/dist/features/documents/DocumentRenderer.js +42 -42
- package/dist/features/feature-registry/FeatureRegistryProvider.js +15 -17
- package/dist/features/feature-registry/available-features.js +3 -2
- package/dist/features/feature-registry/index.js +1 -1
- package/dist/features/file-explorer/api/files.js +8 -3
- package/dist/features/file-explorer/components/FileExplorerPanel.js +64 -43
- package/dist/features/file-explorer/file-explorer-feature.js +15 -7
- package/dist/features/file-explorer/hooks/useFileExplorer.js +31 -29
- package/dist/features/file-explorer/index.js +1 -1
- package/dist/features/file-explorer/providers/FileExplorerProvider.js +77 -77
- package/dist/features/git/components/WorkbenchGitPanel.js +1 -1
- package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
- package/dist/features/workbench/Workbench.js +16 -16
- package/dist/features/workbench/components/NewRunDialog.js +1 -1
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +1 -1
- package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
- package/dist/features/workbench/index.js +1 -1
- package/dist/features/workspaces/Workspaces.js +1 -1
- package/dist/hooks/useSecrets.js +9 -45
- package/dist/index.d.ts +27 -13
- package/dist/index.js +6 -6
- package/dist/loopstack-studio.css +1 -1
- package/dist/pages/EmbedWorkbenchPage.js +46 -40
- package/dist/pages/WorkbenchPage.js +50 -45
- package/dist/pages/WorkspacePage.js +39 -25
- package/dist/pages/WorkspaceRunsPage.js +34 -26
- package/dist/providers/InvalidationEventsProvider.js +22 -20
- 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:
|
|
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
|
|
14
|
-
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
let
|
|
18
|
-
|
|
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:
|
|
21
|
-
url:
|
|
22
|
-
},
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}) }),
|
|
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(
|
|
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
|
|
62
|
-
l[20] ===
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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:
|
|
77
|
-
}), l[
|
|
78
|
-
let
|
|
79
|
-
l[
|
|
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
|
-
|
|
80
|
+
P
|
|
85
81
|
]
|
|
86
|
-
}), l[
|
|
87
|
-
let
|
|
88
|
-
return l[
|
|
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:
|
|
91
|
-
}), l[
|
|
86
|
+
children: F
|
|
87
|
+
}), l[30] = F, l[31] = C, l[32] = I) : I = l[32], I;
|
|
92
88
|
};
|
|
93
|
-
function _temp(
|
|
94
|
-
return
|
|
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(
|
|
100
|
-
let [a, o] =
|
|
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
|
|
13
|
-
let S =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
className: "flex
|
|
30
|
-
children: [/* @__PURE__ */
|
|
31
|
-
className: "
|
|
32
|
-
children:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
},
|
|
54
|
-
} else
|
|
55
|
-
let
|
|
56
|
-
|
|
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:
|
|
100
|
+
children: B
|
|
61
101
|
})
|
|
62
|
-
}),
|
|
63
|
-
let
|
|
64
|
-
|
|
65
|
-
let
|
|
66
|
-
|
|
67
|
-
types:
|
|
68
|
-
onSuccess:
|
|
69
|
-
}),
|
|
70
|
-
let
|
|
71
|
-
|
|
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:
|
|
74
|
-
}),
|
|
75
|
-
let
|
|
76
|
-
|
|
77
|
-
open:
|
|
78
|
-
onOpenChange:
|
|
79
|
-
children:
|
|
80
|
-
}),
|
|
81
|
-
let
|
|
82
|
-
return
|
|
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:
|
|
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:
|
|
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:
|
|
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(
|
|
38
|
+
timestamp: new Date(v.createdAt),
|
|
39
39
|
children: /* @__PURE__ */ jsx(DocumentFormRenderer_default, {
|
|
40
40
|
parentWorkflow: e,
|
|
41
|
-
workflow:
|
|
42
|
-
document:
|
|
43
|
-
enabled:
|
|
44
|
-
viewOnly: !
|
|
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:
|
|
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:
|
|
55
|
+
["oauth-prompt", ({ parentWorkflow: e, workflow: g, document: _, isActive: y }) => /* @__PURE__ */ jsx(OAuthPromptRenderer_default, {
|
|
56
56
|
parentWorkflow: e,
|
|
57
|
-
workflow:
|
|
58
|
-
document:
|
|
59
|
-
isActive:
|
|
57
|
+
workflow: g,
|
|
58
|
+
document: _,
|
|
59
|
+
isActive: y
|
|
60
60
|
})],
|
|
61
|
-
["text-prompt", ({ parentWorkflow: e, workflow:
|
|
61
|
+
["text-prompt", ({ parentWorkflow: e, workflow: g, document: _, isActive: v }) => /* @__PURE__ */ jsx(TextPromptRenderer_default, {
|
|
62
62
|
parentWorkflow: e,
|
|
63
|
-
workflow:
|
|
64
|
-
document:
|
|
65
|
-
isActive:
|
|
63
|
+
workflow: g,
|
|
64
|
+
document: _,
|
|
65
|
+
isActive: v
|
|
66
66
|
})],
|
|
67
|
-
["choices", ({ parentWorkflow: e, workflow:
|
|
67
|
+
["choices", ({ parentWorkflow: e, workflow: g, document: _, isActive: v }) => /* @__PURE__ */ jsx(ChoicesRenderer_default, {
|
|
68
68
|
parentWorkflow: e,
|
|
69
|
-
workflow:
|
|
70
|
-
document:
|
|
71
|
-
isActive:
|
|
69
|
+
workflow: g,
|
|
70
|
+
document: _,
|
|
71
|
+
isActive: v
|
|
72
72
|
})],
|
|
73
|
-
["confirm-prompt", ({ parentWorkflow: e, workflow:
|
|
73
|
+
["confirm-prompt", ({ parentWorkflow: e, workflow: g, document: _, isActive: v }) => /* @__PURE__ */ jsx(ConfirmPromptRenderer_default, {
|
|
74
74
|
parentWorkflow: e,
|
|
75
|
-
workflow:
|
|
76
|
-
document:
|
|
77
|
-
isActive:
|
|
75
|
+
workflow: g,
|
|
76
|
+
document: _,
|
|
77
|
+
isActive: v
|
|
78
78
|
})]
|
|
79
79
|
]);
|
|
80
80
|
function resolveWidgetName(e) {
|
|
81
|
-
let
|
|
82
|
-
return
|
|
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 =
|
|
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
|
-
|
|
90
|
-
for (let e of y) if (e.documentRenderers) for (let [
|
|
91
|
-
v[4] = y, v[5] =
|
|
92
|
-
} else
|
|
93
|
-
let
|
|
94
|
-
S = coreRendererRegistry.get(e) ??
|
|
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] !==
|
|
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
|
|
8
|
-
return e
|
|
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(
|
|
12
|
-
s[0]
|
|
13
|
-
let
|
|
14
|
-
s[
|
|
15
|
-
let
|
|
16
|
-
s[5]
|
|
17
|
-
|
|
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[
|
|
22
|
-
let
|
|
23
|
-
return s[
|
|
24
|
-
value:
|
|
25
|
-
children:
|
|
26
|
-
}), s[
|
|
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 {
|
|
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
|
-
|
|
9
|
+
localFileExplorer: localFileExplorerFeature,
|
|
10
|
+
remoteFileExplorer: remoteFileExplorerFeature,
|
|
10
11
|
secrets: secretsFeature
|
|
11
12
|
};
|
|
12
13
|
export { AVAILABLE_FEATURES };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
|
|
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: (
|
|
4
|
-
readFile: (
|
|
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 };
|