@loopstack/loopstack-studio 0.32.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/api/workflows.js +1 -0
- package/dist/app/EnvironmentEmbedRoot.js +22 -24
- package/dist/components/loopstack-elements/link.js +64 -56
- 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/documents/renderers/LinkMessageRenderer.js +10 -10
- 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/index.js +2 -2
- package/dist/hooks/query-keys.js +39 -32
- package/dist/hooks/useSecrets.js +9 -45
- package/dist/hooks/useWorkflows.js +73 -61
- package/dist/index.d.ts +39 -13
- package/dist/index.js +8 -8
- 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
|
@@ -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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useWorkflowStatus } from "../../../hooks/useWorkflows.js";
|
|
2
2
|
import { WorkflowState } from "../../../packages/contracts/dist/enums/workflow-state.enum.js";
|
|
3
3
|
import "../../../packages/contracts/dist/enums/index.js";
|
|
4
4
|
import link_default from "../../../components/loopstack-elements/link.js";
|
|
@@ -14,15 +14,15 @@ function mapWorkflowStateToStatus(e) {
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
var LinkMessageRenderer_default = (a) => {
|
|
17
|
-
let o = c(
|
|
18
|
-
o[0]
|
|
19
|
-
let _ = g, v;
|
|
20
|
-
return o[
|
|
21
|
-
href:
|
|
22
|
-
label:
|
|
17
|
+
let o = c(8), { document: s } = a, { label: l, workflowId: u, embed: d, expanded: f } = s.content, p = u ? `/workflows/${u}` : void 0, m = useWorkflowStatus(u), h = m.data?.status, g;
|
|
18
|
+
o[0] === h ? g = o[1] : (g = mapWorkflowStateToStatus(h), o[0] = h, o[1] = g);
|
|
19
|
+
let _ = g, v = m.isSuccess ? f === !0 && _ === "pending" : void 0, y;
|
|
20
|
+
return o[2] !== d || o[3] !== p || o[4] !== v || o[5] !== l || o[6] !== _ ? (y = /* @__PURE__ */ jsx(link_default, {
|
|
21
|
+
href: p,
|
|
22
|
+
label: l,
|
|
23
23
|
status: _,
|
|
24
|
-
embed:
|
|
25
|
-
defaultExpanded:
|
|
26
|
-
}), o[
|
|
24
|
+
embed: d,
|
|
25
|
+
defaultExpanded: v
|
|
26
|
+
}), o[2] = d, o[3] = p, o[4] = v, o[5] = l, o[6] = _, o[7] = y) : y = o[7], y;
|
|
27
27
|
};
|
|
28
28
|
export { LinkMessageRenderer_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 };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { FileContentViewer } from "../../code-explorer/components/FileContentViewer.js";
|
|
2
2
|
import "../../code-explorer/index.js";
|
|
3
|
+
import { useFeatureConfig } from "../../feature-registry/FeatureRegistryProvider.js";
|
|
4
|
+
import "../../feature-registry/index.js";
|
|
3
5
|
import { useWorkbenchLayout } from "../../workbench/providers/WorkbenchLayoutProvider.js";
|
|
4
|
-
import "../../workbench/index.js";
|
|
5
6
|
import { SidebarPanel } from "../../workbench/components/SidebarPanel.js";
|
|
7
|
+
import "../../workbench/index.js";
|
|
6
8
|
import { FileExplorerProvider, useOptionalFileExplorer } from "../providers/FileExplorerProvider.js";
|
|
7
9
|
import { FileTabsBar } from "./FileTabsBar.js";
|
|
8
10
|
import { FileTree } from "./FileTree.js";
|
|
9
|
-
import { useFeatureConfig } from "../../feature-registry/FeatureRegistryProvider.js";
|
|
10
|
-
import "../../feature-registry/index.js";
|
|
11
11
|
import { c } from "react/compiler-runtime";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { Files } from "lucide-react";
|
|
@@ -28,14 +28,14 @@ function FileExplorerContent() {
|
|
|
28
28
|
className: "w-52 shrink-0 overflow-auto border-r bg-muted/40",
|
|
29
29
|
children: /* @__PURE__ */ jsx(FileTree, {})
|
|
30
30
|
}), i[1] = o) : o = i[1];
|
|
31
|
-
let
|
|
32
|
-
i[2] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
31
|
+
let s;
|
|
32
|
+
i[2] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ jsx(FileTabsBar, {}), i[2] = s) : s = i[2];
|
|
33
33
|
let p;
|
|
34
34
|
return i[3] !== a.fileContent || i[4] !== a.isContentLoading || i[5] !== a.selectedFile ? (p = /* @__PURE__ */ jsxs("div", {
|
|
35
35
|
className: "flex h-full",
|
|
36
36
|
children: [o, /* @__PURE__ */ jsxs("div", {
|
|
37
37
|
className: "flex min-w-0 flex-1 flex-col",
|
|
38
|
-
children: [
|
|
38
|
+
children: [s, /* @__PURE__ */ jsx("div", {
|
|
39
39
|
className: "flex-1 overflow-hidden p-3 pt-2",
|
|
40
40
|
children: /* @__PURE__ */ jsx(FileContentViewer, {
|
|
41
41
|
selectedFile: a.selectedFile,
|
|
@@ -48,52 +48,73 @@ function FileExplorerContent() {
|
|
|
48
48
|
}), i[3] = a.fileContent, i[4] = a.isContentLoading, i[5] = a.selectedFile, i[6] = p) : p = i[6], p;
|
|
49
49
|
}
|
|
50
50
|
function FileExplorerPanel(e) {
|
|
51
|
-
let
|
|
52
|
-
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
let
|
|
56
|
-
if (!
|
|
51
|
+
let l = c(26), { variant: u, featureId: d, title: f, description: m, workspaceId: h } = e, { closePanel: g, panelSize: _, setPanelSize: v, environments: y } = useWorkbenchLayout(), b = useFeatureConfig(d), x;
|
|
52
|
+
l[0] === b?.config?.environments ? x = l[1] : (x = b?.config?.environments ?? [], l[0] = b?.config?.environments, l[1] = x);
|
|
53
|
+
let S = x, C = y?.[0]?.slotId ?? "", w;
|
|
54
|
+
l[2] !== S || l[3] !== C ? (w = S.length === 0 || S.includes(C), l[2] = S, l[3] = C, l[4] = w) : w = l[4];
|
|
55
|
+
let T = w;
|
|
56
|
+
if (!T) {
|
|
57
57
|
let e;
|
|
58
|
-
|
|
58
|
+
l[5] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx(Files, { className: "h-4 w-4" }), l[5] = e) : e = l[5];
|
|
59
59
|
let i;
|
|
60
|
-
|
|
60
|
+
l[6] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ jsx("div", {
|
|
61
61
|
className: "flex flex-1 items-center justify-center p-4",
|
|
62
62
|
children: /* @__PURE__ */ jsx("p", {
|
|
63
63
|
className: "text-muted-foreground text-sm",
|
|
64
64
|
children: "File explorer is not available for this environment."
|
|
65
65
|
})
|
|
66
|
-
}),
|
|
67
|
-
let
|
|
68
|
-
return
|
|
66
|
+
}), l[6] = i) : i = l[6];
|
|
67
|
+
let a;
|
|
68
|
+
return l[7] !== g || l[8] !== m || l[9] !== _ || l[10] !== v || l[11] !== f ? (a = /* @__PURE__ */ jsx(SidebarPanel, {
|
|
69
69
|
icon: e,
|
|
70
|
-
title:
|
|
71
|
-
description:
|
|
72
|
-
size:
|
|
73
|
-
onSizeChange:
|
|
74
|
-
onClose:
|
|
70
|
+
title: f,
|
|
71
|
+
description: m,
|
|
72
|
+
size: _,
|
|
73
|
+
onSizeChange: v,
|
|
74
|
+
onClose: g,
|
|
75
75
|
children: i
|
|
76
|
-
}),
|
|
76
|
+
}), l[7] = g, l[8] = m, l[9] = _, l[10] = v, l[11] = f, l[12] = a) : a = l[12], a;
|
|
77
77
|
}
|
|
78
|
-
let
|
|
79
|
-
|
|
80
|
-
let
|
|
81
|
-
|
|
82
|
-
let
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
78
|
+
let E;
|
|
79
|
+
l[13] === Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ jsx(Files, { className: "h-4 w-4" }), l[13] = E) : E = l[13];
|
|
80
|
+
let D;
|
|
81
|
+
l[14] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ jsx(FileExplorerContent, {}), l[14] = D) : D = l[14];
|
|
82
|
+
let O;
|
|
83
|
+
l[15] !== T || l[16] !== u || l[17] !== h ? (O = /* @__PURE__ */ jsx(FileExplorerProvider, {
|
|
84
|
+
variant: u,
|
|
85
|
+
workspaceId: h,
|
|
86
|
+
enabled: T,
|
|
87
|
+
children: D
|
|
88
|
+
}), l[15] = T, l[16] = u, l[17] = h, l[18] = O) : O = l[18];
|
|
89
|
+
let k;
|
|
90
|
+
return l[19] !== g || l[20] !== m || l[21] !== _ || l[22] !== v || l[23] !== O || l[24] !== f ? (k = /* @__PURE__ */ jsx(SidebarPanel, {
|
|
91
|
+
icon: E,
|
|
92
|
+
title: f,
|
|
93
|
+
description: m,
|
|
94
|
+
size: _,
|
|
95
|
+
onSizeChange: v,
|
|
96
|
+
onClose: g,
|
|
97
|
+
children: O
|
|
98
|
+
}), l[19] = g, l[20] = m, l[21] = _, l[22] = v, l[23] = O, l[24] = f, l[25] = k) : k = l[25], k;
|
|
99
|
+
}
|
|
100
|
+
function LocalFileExplorerPanel(e) {
|
|
101
|
+
let i = c(2), { workspaceId: a } = e, o;
|
|
102
|
+
return i[0] === a ? o = i[1] : (o = /* @__PURE__ */ jsx(FileExplorerPanel, {
|
|
103
|
+
variant: "local",
|
|
104
|
+
featureId: "localFileExplorer",
|
|
91
105
|
title: "Files",
|
|
92
|
-
description: "Browse and view files.",
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
106
|
+
description: "Browse and view local project files.",
|
|
107
|
+
workspaceId: a
|
|
108
|
+
}), i[0] = a, i[1] = o), o;
|
|
109
|
+
}
|
|
110
|
+
function RemoteFileExplorerPanel(e) {
|
|
111
|
+
let i = c(2), { workspaceId: a } = e, o;
|
|
112
|
+
return i[0] === a ? o = i[1] : (o = /* @__PURE__ */ jsx(FileExplorerPanel, {
|
|
113
|
+
variant: "remote",
|
|
114
|
+
featureId: "remoteFileExplorer",
|
|
115
|
+
title: "Remote Files",
|
|
116
|
+
description: "Browse and view files on the remote workspace.",
|
|
117
|
+
workspaceId: a
|
|
118
|
+
}), i[0] = a, i[1] = o), o;
|
|
98
119
|
}
|
|
99
|
-
export {
|
|
120
|
+
export { LocalFileExplorerPanel, RemoteFileExplorerPanel };
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Files } from "lucide-react";
|
|
3
|
-
const
|
|
4
|
-
id: "file-explorer",
|
|
1
|
+
import { LocalFileExplorerPanel, RemoteFileExplorerPanel } from "./components/FileExplorerPanel.js";
|
|
2
|
+
import { Cloud, Files } from "lucide-react";
|
|
3
|
+
const localFileExplorerFeature = {
|
|
4
|
+
id: "local-file-explorer",
|
|
5
5
|
sidebarPanel: {
|
|
6
|
-
id: "files",
|
|
6
|
+
id: "local-files",
|
|
7
7
|
label: "Files",
|
|
8
8
|
icon: Files,
|
|
9
|
-
component:
|
|
9
|
+
component: LocalFileExplorerPanel
|
|
10
|
+
}
|
|
11
|
+
}, remoteFileExplorerFeature = {
|
|
12
|
+
id: "remote-file-explorer",
|
|
13
|
+
sidebarPanel: {
|
|
14
|
+
id: "remote-files",
|
|
15
|
+
label: "Remote Files",
|
|
16
|
+
icon: Cloud,
|
|
17
|
+
component: RemoteFileExplorerPanel
|
|
10
18
|
}
|
|
11
19
|
};
|
|
12
|
-
export {
|
|
20
|
+
export { localFileExplorerFeature, remoteFileExplorerFeature };
|
|
@@ -1,44 +1,46 @@
|
|
|
1
1
|
import { useApiClient } from "../../../hooks/useApi.js";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { useQuery } from "@tanstack/react-query";
|
|
4
|
-
function useFileTree(r, i) {
|
|
5
|
-
let a = c(10), o = i === void 0 ? !0 : i, { envKey: s, api: l } = useApiClient(), u;
|
|
6
|
-
a[0] !== s || a[1] !== r ? (u = [
|
|
7
|
-
"file-explorer-tree",
|
|
8
|
-
s,
|
|
9
|
-
r
|
|
10
|
-
], a[0] = s, a[1] = r, a[2] = u) : u = a[2];
|
|
11
|
-
let d;
|
|
12
|
-
a[3] !== l || a[4] !== r ? (d = () => l.files.getTree({ workspaceId: r }), a[3] = l, a[4] = r, a[5] = d) : d = a[5];
|
|
13
|
-
let f = !!r && o, p;
|
|
14
|
-
return a[6] !== u || a[7] !== d || a[8] !== f ? (p = {
|
|
15
|
-
queryKey: u,
|
|
16
|
-
queryFn: d,
|
|
17
|
-
enabled: f,
|
|
18
|
-
staleTime: 3e4,
|
|
19
|
-
retry: !1
|
|
20
|
-
}, a[6] = u, a[7] = d, a[8] = f, a[9] = p) : p = a[9], useQuery(p);
|
|
21
|
-
}
|
|
22
|
-
function useFileContent(r, i, a) {
|
|
4
|
+
function useFileTree(r, i, a) {
|
|
23
5
|
let o = c(12), s = a === void 0 ? !0 : a, { envKey: l, api: u } = useApiClient(), d;
|
|
24
|
-
o[0] !== l || o[1] !==
|
|
25
|
-
"file-explorer-
|
|
26
|
-
l,
|
|
6
|
+
o[0] !== l || o[1] !== r || o[2] !== i ? (d = [
|
|
7
|
+
"file-explorer-tree",
|
|
27
8
|
r,
|
|
9
|
+
l,
|
|
28
10
|
i
|
|
29
|
-
], o[0] = l, o[1] =
|
|
11
|
+
], o[0] = l, o[1] = r, o[2] = i, o[3] = d) : d = o[3];
|
|
30
12
|
let f;
|
|
31
|
-
o[4] !== u || o[5] !==
|
|
32
|
-
|
|
33
|
-
path: i
|
|
34
|
-
}), o[4] = u, o[5] = i, o[6] = r, o[7] = f) : f = o[7];
|
|
35
|
-
let p = !!r && !!i && s, m;
|
|
13
|
+
o[4] !== u || o[5] !== r || o[6] !== i ? (f = () => u.files[r].getTree({ workspaceId: i }), o[4] = u, o[5] = r, o[6] = i, o[7] = f) : f = o[7];
|
|
14
|
+
let p = !!i && s, m;
|
|
36
15
|
return o[8] !== d || o[9] !== f || o[10] !== p ? (m = {
|
|
37
16
|
queryKey: d,
|
|
38
17
|
queryFn: f,
|
|
39
18
|
enabled: p,
|
|
40
|
-
staleTime:
|
|
19
|
+
staleTime: 3e4,
|
|
41
20
|
retry: !1
|
|
42
21
|
}, o[8] = d, o[9] = f, o[10] = p, o[11] = m) : m = o[11], useQuery(m);
|
|
43
22
|
}
|
|
23
|
+
function useFileContent(r, i, a, o) {
|
|
24
|
+
let s = c(14), l = o === void 0 ? !0 : o, { envKey: u, api: d } = useApiClient(), f;
|
|
25
|
+
s[0] !== u || s[1] !== a || s[2] !== r || s[3] !== i ? (f = [
|
|
26
|
+
"file-explorer-content",
|
|
27
|
+
r,
|
|
28
|
+
u,
|
|
29
|
+
i,
|
|
30
|
+
a
|
|
31
|
+
], s[0] = u, s[1] = a, s[2] = r, s[3] = i, s[4] = f) : f = s[4];
|
|
32
|
+
let p;
|
|
33
|
+
s[5] !== d || s[6] !== a || s[7] !== r || s[8] !== i ? (p = () => d.files[r].readFile({
|
|
34
|
+
workspaceId: i,
|
|
35
|
+
path: a
|
|
36
|
+
}), s[5] = d, s[6] = a, s[7] = r, s[8] = i, s[9] = p) : p = s[9];
|
|
37
|
+
let m = !!i && !!a && l, h;
|
|
38
|
+
return s[10] !== f || s[11] !== p || s[12] !== m ? (h = {
|
|
39
|
+
queryKey: f,
|
|
40
|
+
queryFn: p,
|
|
41
|
+
enabled: m,
|
|
42
|
+
staleTime: 15e3,
|
|
43
|
+
retry: !1
|
|
44
|
+
}, s[10] = f, s[11] = p, s[12] = m, s[13] = h) : h = s[13], useQuery(h);
|
|
45
|
+
}
|
|
44
46
|
export { useFileContent, useFileTree };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FileExplorerProvider, useFileExplorer, useOptionalFileExplorer } from "./providers/FileExplorerProvider.js";
|
|
2
|
-
import {
|
|
2
|
+
import { localFileExplorerFeature, remoteFileExplorerFeature } from "./file-explorer-feature.js";
|