@loopstack/loopstack-studio 0.33.0 → 0.35.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/app/EnvironmentEmbedRoot.js +17 -25
- package/dist/components/layout/StudioSidebar.js +34 -34
- package/dist/components/messages/CompletionMessagePaper.js +25 -29
- package/dist/events/api-client-events.js +13 -1
- package/dist/events/index.js +1 -0
- package/dist/features/code-explorer/components/FileTabsBarBase.js +1 -1
- package/dist/features/code-explorer/index.js +0 -3
- package/dist/features/dashboard/AppLauncher.js +111 -64
- package/dist/features/debug/components/WorkflowFlowViewer.js +2 -1
- package/dist/features/debug/components/workflow-flow/WorkflowGraph.js +2 -1
- package/dist/features/documents/DocumentRenderer.js +42 -42
- package/dist/features/documents/components/DocumentList.js +1 -1
- package/dist/features/documents/document-details/DocumentDetails.js +0 -5
- package/dist/features/documents/renderers/DocumentFormRenderer.js +13 -12
- package/dist/features/documents/renderers/LinkMessageRenderer.js +2 -1
- package/dist/features/documents/renderers/useDocumentTransition.js +3 -2
- package/dist/features/feature-registry/FeatureRegistryProvider.js +17 -18
- package/dist/features/feature-registry/available-features.js +3 -2
- package/dist/features/feature-registry/index.js +1 -1
- package/dist/features/file-explorer/components/FileExplorerPanel.js +64 -43
- package/dist/features/file-explorer/components/FileTabsBar.js +1 -1
- package/dist/features/file-explorer/components/FileTree.js +1 -1
- package/dist/features/file-explorer/file-explorer-feature.js +15 -7
- package/dist/features/file-explorer/hooks/useFileExplorer.js +41 -34
- package/dist/features/file-explorer/index.js +1 -1
- package/dist/features/file-explorer/providers/FileExplorerProvider.js +91 -89
- package/dist/features/git/components/WorkbenchGitPanel.js +7 -10
- package/dist/features/git/hooks/useGit.js +55 -57
- package/dist/features/health/LocalHealthCheck.js +46 -47
- package/dist/features/oauth/OAuthPromptRenderer.js +6 -5
- package/dist/features/runs/Runs.js +3 -2
- package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
- package/dist/features/secrets/renderers/SecretInputRenderer.js +3 -2
- package/dist/features/workbench/Workbench.js +16 -16
- package/dist/features/workbench/WorkflowItem.js +5 -8
- package/dist/features/workbench/components/NewRunDialog.js +173 -171
- package/dist/features/workbench/components/PreviewEmptyState.js +1 -1
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +1 -1
- package/dist/features/workbench/components/WorkbenchRunsPanel.js +2 -1
- package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
- package/dist/features/workbench/components/WorkflowForms.js +1 -1
- package/dist/features/workbench/components/WorkflowHistoryItem.js +2 -1
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +8 -14
- package/dist/features/workbench/hooks/useLlmStreamingDocuments.js +65 -132
- package/dist/features/workbench/hooks/useWorkflowData.js +8 -6
- package/dist/features/workbench/index.js +1 -1
- package/dist/features/workspaces/Workspaces.js +5 -3
- package/dist/features/workspaces/components/CreateWorkspace.js +7 -5
- package/dist/features/workspaces/components/ExecutionTimeline.js +69 -65
- package/dist/features/workspaces/components/WorkflowRunForm.js +6 -4
- package/dist/features/workspaces/components/WorkspaceHomePage.js +1 -1
- package/dist/hooks/index.js +5 -5
- package/dist/hooks/useAuth.js +14 -53
- package/dist/hooks/useConfig.js +13 -37
- package/dist/hooks/useDocuments.js +5 -30
- package/dist/hooks/useEnvironments.js +34 -24
- package/dist/hooks/useProcessor.js +2 -31
- package/dist/hooks/useSecrets.js +71 -53
- package/dist/hooks/useWorkflows.js +43 -172
- package/dist/hooks/useWorkspaces.js +24 -130
- package/dist/index.d.ts +137 -481
- package/dist/index.js +15 -17
- package/dist/loopstack-studio.css +1 -1
- package/dist/packages/client/dist/client.js +35 -0
- package/dist/packages/client/dist/http.js +47 -0
- package/dist/packages/client/dist/index.js +15 -0
- package/dist/packages/client/dist/queries/query-keys.js +94 -0
- package/dist/packages/client/dist/queries/query-options.js +97 -0
- package/dist/packages/client/dist/resources/auth.js +10 -0
- package/dist/packages/client/dist/resources/config.js +11 -0
- package/dist/packages/client/dist/resources/dashboard.js +4 -0
- package/dist/packages/client/dist/resources/documents.js +7 -0
- package/dist/packages/client/dist/resources/processor.js +7 -0
- package/dist/packages/client/dist/resources/workflows.js +13 -0
- package/dist/packages/client/dist/resources/workspaces.js +12 -0
- package/dist/packages/client/dist/stream/invalidations.js +20 -0
- package/dist/packages/client/dist/stream/llm-reducer.js +65 -0
- package/dist/packages/client/dist/stream/sse-parser.js +40 -0
- package/dist/packages/client/dist/stream/stream.js +147 -0
- package/dist/packages/contracts/dist/events/client-message-base.schema.js +6 -0
- package/dist/packages/contracts/dist/events/client-message.schema.js +24 -0
- package/dist/packages/contracts/dist/events/index.js +6 -0
- package/dist/packages/contracts/dist/events/llm-events.schema.js +44 -0
- package/dist/packages/contracts/dist/events/stream-events.schema.js +4 -0
- package/dist/packages/contracts/dist/events/workflow-events.schema.js +20 -0
- package/dist/packages/contracts/dist/events/workspace-events.schema.js +5 -0
- package/dist/packages/contracts/dist/types/types/ui-message.type.js +39 -0
- package/dist/packages/react/dist/hooks/mutations.js +175 -0
- package/dist/packages/react/dist/hooks/queries.js +139 -0
- package/dist/packages/react/dist/hooks/use-live-invalidation.js +39 -0
- package/dist/packages/react/dist/hooks/use-llm-stream.js +18 -0
- package/dist/packages/react/dist/index.js +5 -0
- package/dist/packages/react/dist/provider.js +15 -0
- package/dist/pages/DashboardPage.js +2 -1
- package/dist/pages/DebugWorkflowDetailsPage.js +2 -1
- package/dist/pages/DebugWorkflowsPage.js +2 -1
- package/dist/pages/EmbedWorkbenchPage.js +50 -43
- package/dist/pages/PreviewWorkbenchPage.js +60 -59
- package/dist/pages/StudioLandingPage.js +1 -1
- package/dist/pages/WorkbenchPage.js +53 -47
- package/dist/pages/WorkflowDebugPage.js +3 -2
- package/dist/pages/WorkspacePage.js +42 -27
- package/dist/pages/WorkspaceRunsPage.js +36 -27
- package/dist/providers/LoopstackClientProvider.js +31 -0
- package/dist/services/createApiClient.js +9 -3
- package/dist/services/index.js +0 -1
- package/dist/services/reporting-fetch.js +13 -0
- package/package.json +4 -3
- package/dist/api/auth.js +0 -10
- package/dist/api/client.js +0 -13
- package/dist/api/config.js +0 -11
- package/dist/api/dashboard.js +0 -4
- package/dist/api/documents.js +0 -7
- package/dist/api/environments.js +0 -8
- package/dist/api/index.js +0 -28
- package/dist/api/processor.js +0 -7
- package/dist/api/secrets.js +0 -16
- package/dist/api/workflows.js +0 -15
- package/dist/api/workspaces.js +0 -12
- package/dist/events/sse-client-events.js +0 -13
- package/dist/features/code-explorer/CodeExplorer.js +0 -6
- package/dist/features/code-explorer/components/CodeExplorerTree.js +0 -6
- package/dist/features/code-explorer/components/FileTabsBar.js +0 -4
- package/dist/features/code-explorer/providers/CodeExplorerProvider.js +0 -5
- package/dist/features/file-explorer/api/files.js +0 -7
- package/dist/features/git/api/git.js +0 -9
- package/dist/hooks/query-keys.js +0 -145
- package/dist/hooks/useApi.js +0 -15
- package/dist/hooks/useFiles.js +0 -3
- package/dist/node_modules/lodash/_Symbol.js +0 -7
- package/dist/node_modules/lodash/_baseGetTag.js +0 -13
- package/dist/node_modules/lodash/_baseTrim.js +0 -11
- package/dist/node_modules/lodash/_freeGlobal.js +0 -6
- package/dist/node_modules/lodash/_getRawTag.js +0 -17
- package/dist/node_modules/lodash/_objectToString.js +0 -10
- package/dist/node_modules/lodash/_root.js +0 -8
- package/dist/node_modules/lodash/_trimmedEndIndex.js +0 -11
- package/dist/node_modules/lodash/debounce.js +0 -53
- package/dist/node_modules/lodash/isObject.js +0 -10
- package/dist/node_modules/lodash/isObjectLike.js +0 -9
- package/dist/node_modules/lodash/isSymbol.js +0 -12
- package/dist/node_modules/lodash/now.js +0 -10
- package/dist/node_modules/lodash/toNumber.js +0 -22
- package/dist/providers/InvalidationEventsProvider.js +0 -41
- package/dist/providers/SseProvider.js +0 -37
- package/dist/services/eventEmitter.js +0 -12
|
@@ -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,6 +1,6 @@
|
|
|
1
|
-
import { useDocumentConfigs } from "../../../hooks/useConfig.js";
|
|
2
1
|
import { WorkflowState } from "../../../packages/contracts/dist/enums/workflow-state.enum.js";
|
|
3
2
|
import "../../../packages/contracts/dist/enums/index.js";
|
|
3
|
+
import { useDocumentConfigs } from "../../../hooks/useConfig.js";
|
|
4
4
|
import DocumentItem_default from "./DocumentItem.js";
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
6
6
|
import React, { useEffect } from "react";
|
|
@@ -257,11 +257,6 @@ var formatDate = (e) => {
|
|
|
257
257
|
className: "text-xs capitalize",
|
|
258
258
|
children: a.level
|
|
259
259
|
}),
|
|
260
|
-
a?.hidden && /* @__PURE__ */ jsx(Badge, {
|
|
261
|
-
variant: "outline",
|
|
262
|
-
className: "text-xs",
|
|
263
|
-
children: "Hidden"
|
|
264
|
-
}),
|
|
265
260
|
m.invalidate && /* @__PURE__ */ jsx(Badge, {
|
|
266
261
|
variant: "outline",
|
|
267
262
|
className: "text-xs",
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { useRunWorkflow } from "../../../packages/react/dist/hooks/mutations.js";
|
|
1
2
|
import { useDocumentConfigs } from "../../../hooks/useConfig.js";
|
|
2
3
|
import { Button } from "../../../components/ui/button.js";
|
|
3
|
-
import
|
|
4
|
+
import "../../../hooks/useProcessor.js";
|
|
4
5
|
import Form_default from "../../../components/dynamic-form/Form.js";
|
|
5
6
|
import { c } from "react/compiler-runtime";
|
|
6
7
|
import React, { useEffect } from "react";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { z } from "zod";
|
|
8
10
|
import { Loader2 } from "lucide-react";
|
|
9
11
|
import { useForm } from "react-hook-form";
|
|
10
|
-
import "zod";
|
|
11
12
|
function resolveFormConfig(e) {
|
|
12
13
|
let d = e, f = (d?.widgets)?.find((e) => e.widget === "form");
|
|
13
14
|
if (f?.options) {
|
|
@@ -55,7 +56,7 @@ var DocumentFormRenderer_default = (m) => {
|
|
|
55
56
|
}
|
|
56
57
|
x.mutate({
|
|
57
58
|
workflowId: g.id,
|
|
58
|
-
|
|
59
|
+
payload: { transition: {
|
|
59
60
|
id: e,
|
|
60
61
|
workflowId: _.id,
|
|
61
62
|
payload: d
|
|
@@ -65,9 +66,9 @@ var DocumentFormRenderer_default = (m) => {
|
|
|
65
66
|
C?.type === "object" ? A(e, d) : A(e, d.raw);
|
|
66
67
|
}, M = (e) => {
|
|
67
68
|
e.transition && E.handleSubmit((d) => j(e.transition)(d), _temp2)();
|
|
68
|
-
}, { formUi: N, actions: P } = resolveFormConfig(S?.ui), F = !!N?.form?.disabled, I = !y || F || !1, L = Form_default, R = C ?? {},
|
|
69
|
+
}, { formUi: N, actions: P } = resolveFormConfig(S?.ui), F = !!N?.form?.disabled, I = !y || F || !1, L = Form_default, R = C ?? {}, B = N ?? void 0, V = S?.meta?.mimeType, H = !b && P.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
69
70
|
className: "flex w-full flex-col items-end gap-4",
|
|
70
|
-
children: P.map((e,
|
|
71
|
+
children: P.map((e, d) => {
|
|
71
72
|
let p = I || e.transition !== void 0 && !k.includes(e.transition);
|
|
72
73
|
return /* @__PURE__ */ jsxs(Button, {
|
|
73
74
|
type: "button",
|
|
@@ -77,21 +78,21 @@ var DocumentFormRenderer_default = (m) => {
|
|
|
77
78
|
className: e.type === "button-full-w" ? "w-full" : "w-48",
|
|
78
79
|
...e.props ?? {},
|
|
79
80
|
children: [x.isPending && /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), e.label ?? "Submit"]
|
|
80
|
-
},
|
|
81
|
+
}, d);
|
|
81
82
|
})
|
|
82
|
-
}) : void 0,
|
|
83
|
-
return h[6] !== L || h[7] !== I || h[8] !== E || h[9] !== R || h[10] !==
|
|
83
|
+
}) : void 0, U;
|
|
84
|
+
return h[6] !== L || h[7] !== I || h[8] !== E || h[9] !== R || h[10] !== B || h[11] !== V || h[12] !== H || h[13] !== b ? (U = /* @__PURE__ */ jsx("div", {
|
|
84
85
|
className: "flex",
|
|
85
86
|
children: /* @__PURE__ */ jsx(L, {
|
|
86
87
|
form: E,
|
|
87
88
|
schema: R,
|
|
88
|
-
ui:
|
|
89
|
-
mimeType:
|
|
89
|
+
ui: B,
|
|
90
|
+
mimeType: V,
|
|
90
91
|
disabled: I,
|
|
91
92
|
viewOnly: b,
|
|
92
|
-
actions:
|
|
93
|
+
actions: H
|
|
93
94
|
})
|
|
94
|
-
}), h[6] = L, h[7] = I, h[8] = E, h[9] = R, h[10] =
|
|
95
|
+
}), h[6] = L, h[7] = I, h[8] = E, h[9] = R, h[10] = B, h[11] = V, h[12] = H, h[13] = b, h[14] = U) : U = h[14], U;
|
|
95
96
|
};
|
|
96
97
|
function _temp(e) {
|
|
97
98
|
return e.id;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { useWorkflowStatus } from "../../../hooks/
|
|
1
|
+
import { useWorkflowStatus } from "../../../packages/react/dist/hooks/queries.js";
|
|
2
2
|
import { WorkflowState } from "../../../packages/contracts/dist/enums/workflow-state.enum.js";
|
|
3
3
|
import "../../../packages/contracts/dist/enums/index.js";
|
|
4
|
+
import "../../../hooks/useWorkflows.js";
|
|
4
5
|
import link_default from "../../../components/loopstack-elements/link.js";
|
|
5
6
|
import { c } from "react/compiler-runtime";
|
|
6
7
|
import React from "react";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { useRunWorkflow } from "../../../hooks/
|
|
1
|
+
import { useRunWorkflow } from "../../../packages/react/dist/hooks/mutations.js";
|
|
2
|
+
import "../../../hooks/useProcessor.js";
|
|
2
3
|
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { useCallback } from "react";
|
|
4
5
|
function resolveTransition(e) {
|
|
@@ -15,7 +16,7 @@ function useDocumentTransition(i, a, o) {
|
|
|
15
16
|
s[4] !== f || s[5] !== i.id || s[6] !== l || s[7] !== d || s[8] !== a.id ? (p = (e) => {
|
|
16
17
|
!d || !f || l.mutate({
|
|
17
18
|
workflowId: i.id,
|
|
18
|
-
|
|
19
|
+
payload: { transition: {
|
|
19
20
|
id: d,
|
|
20
21
|
workflowId: a.id,
|
|
21
22
|
payload: e
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { useAppsConfig } from "../../hooks/
|
|
1
|
+
import { useAppsConfig } from "../../packages/react/dist/hooks/queries.js";
|
|
2
|
+
import "../../hooks/useConfig.js";
|
|
2
3
|
import { AVAILABLE_FEATURES } from "./available-features.js";
|
|
3
4
|
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { createContext, useContext, useMemo } from "react";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
var FeatureRegistryContext = createContext([]), BackendFeaturesContext = createContext([]);
|
|
7
|
-
function resolveFeatures(e
|
|
8
|
-
return e
|
|
8
|
+
function resolveFeatures(e) {
|
|
9
|
+
return e.filter((e) => e.enabled !== !1).map((e) => AVAILABLE_FEATURES[e.id]).filter(Boolean);
|
|
9
10
|
}
|
|
10
11
|
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,
|
|
12
|
+
let s = c(11), { appName: l, children: u } = a, { data: d } = useAppsConfig(), f;
|
|
13
|
+
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];
|
|
14
|
+
let p = f, m;
|
|
15
|
+
s[3] === p ? m = s[4] : (m = resolveFeatures(p), s[3] = p, s[4] = m);
|
|
16
|
+
let h = m, g;
|
|
17
|
+
s[5] !== h || s[6] !== u ? (g = /* @__PURE__ */ jsx(FeatureRegistryContext.Provider, {
|
|
18
|
+
value: h,
|
|
20
19
|
children: u
|
|
21
|
-
}), s[
|
|
22
|
-
let
|
|
23
|
-
return s[
|
|
24
|
-
value:
|
|
25
|
-
children:
|
|
26
|
-
}), s[
|
|
20
|
+
}), s[5] = h, s[6] = u, s[7] = g) : g = s[7];
|
|
21
|
+
let _;
|
|
22
|
+
return s[8] !== p || s[9] !== g ? (_ = /* @__PURE__ */ jsx(BackendFeaturesContext.Provider, {
|
|
23
|
+
value: p,
|
|
24
|
+
children: g
|
|
25
|
+
}), s[8] = p, s[9] = g, s[10] = _) : _ = s[10], _;
|
|
27
26
|
}
|
|
28
27
|
function useFeatureRegistry() {
|
|
29
28
|
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,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,5 +1,5 @@
|
|
|
1
|
-
import { FileTabsBarBase } from "../../code-explorer/components/FileTabsBarBase.js";
|
|
2
1
|
import { useFileExplorer } from "../providers/FileExplorerProvider.js";
|
|
2
|
+
import { FileTabsBarBase } from "../../code-explorer/components/FileTabsBarBase.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
function FileTabsBar() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button } from "../../../components/ui/button.js";
|
|
2
2
|
import { ScrollArea } from "../../../components/ui/scroll-area.js";
|
|
3
|
-
import { CodeExplorerTreeNode } from "../../code-explorer/components/CodeExplorerTreeNode.js";
|
|
4
3
|
import { useFileExplorer } from "../providers/FileExplorerProvider.js";
|
|
4
|
+
import { CodeExplorerTreeNode } from "../../code-explorer/components/CodeExplorerTreeNode.js";
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { AlertCircle, Loader2, RefreshCw } from "lucide-react";
|
|
@@ -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,51 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLoopstackClient } from "../../../packages/react/dist/provider.js";
|
|
2
|
+
import "../../../packages/react/dist/index.js";
|
|
2
3
|
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { useQuery } from "@tanstack/react-query";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
var VARIANT_BASE_PATH = {
|
|
6
|
+
local: "local-files",
|
|
7
|
+
remote: "remote-files"
|
|
8
|
+
}, explorerPath = (e, n) => `/api/v1/workspaces/${n}/${VARIANT_BASE_PATH[e]}`;
|
|
9
|
+
function fileTreeKey(e, n, r) {
|
|
10
|
+
return [
|
|
7
11
|
"file-explorer-tree",
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
e,
|
|
13
|
+
...n ? [n] : [],
|
|
14
|
+
...r ? [r] : []
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
function useFileTree(i, o, s) {
|
|
18
|
+
let l = c(12), u = s === void 0 ? !0 : s, d = useLoopstackClient(), f;
|
|
19
|
+
l[0] !== d.envKey || l[1] !== i || l[2] !== o ? (f = fileTreeKey(d.envKey, i, o), l[0] = d.envKey, l[1] = i, l[2] = o, l[3] = f) : f = l[3];
|
|
20
|
+
let p;
|
|
21
|
+
l[4] !== d.http || l[5] !== i || l[6] !== o ? (p = () => d.http.get(`${explorerPath(i, o)}/tree`), l[4] = d.http, l[5] = i, l[6] = o, l[7] = p) : p = l[7];
|
|
22
|
+
let m = !!o && u, h;
|
|
23
|
+
return l[8] !== f || l[9] !== p || l[10] !== m ? (h = {
|
|
24
|
+
queryKey: f,
|
|
25
|
+
queryFn: p,
|
|
26
|
+
enabled: m,
|
|
18
27
|
staleTime: 3e4,
|
|
19
28
|
retry: !1
|
|
20
|
-
},
|
|
29
|
+
}, l[8] = f, l[9] = p, l[10] = m, l[11] = h) : h = l[11], useQuery(h);
|
|
21
30
|
}
|
|
22
|
-
function useFileContent(
|
|
23
|
-
let
|
|
24
|
-
|
|
31
|
+
function useFileContent(i, a, o, s) {
|
|
32
|
+
let l = c(14), u = s === void 0 ? !0 : s, d = useLoopstackClient(), f;
|
|
33
|
+
l[0] !== d.envKey || l[1] !== o || l[2] !== i || l[3] !== a ? (f = [
|
|
25
34
|
"file-explorer-content",
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
queryFn: f,
|
|
39
|
-
enabled: p,
|
|
35
|
+
d.envKey,
|
|
36
|
+
i,
|
|
37
|
+
a,
|
|
38
|
+
o
|
|
39
|
+
], l[0] = d.envKey, l[1] = o, l[2] = i, l[3] = a, l[4] = f) : f = l[4];
|
|
40
|
+
let p;
|
|
41
|
+
l[5] !== d.http || l[6] !== o || l[7] !== i || l[8] !== a ? (p = () => d.http.get(`${explorerPath(i, a)}/read`, { path: o }), l[5] = d.http, l[6] = o, l[7] = i, l[8] = a, l[9] = p) : p = l[9];
|
|
42
|
+
let m = !!a && !!o && u, h;
|
|
43
|
+
return l[10] !== f || l[11] !== p || l[12] !== m ? (h = {
|
|
44
|
+
queryKey: f,
|
|
45
|
+
queryFn: p,
|
|
46
|
+
enabled: m,
|
|
40
47
|
staleTime: 15e3,
|
|
41
48
|
retry: !1
|
|
42
|
-
},
|
|
49
|
+
}, l[10] = f, l[11] = p, l[12] = m, l[13] = h) : h = l[13], useQuery(h);
|
|
43
50
|
}
|
|
44
|
-
export { useFileContent, useFileTree };
|
|
51
|
+
export { fileTreeKey, 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";
|