@loopstack/loopstack-studio 0.29.5 → 0.30.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/_virtual/rolldown_runtime.js +3 -1
- package/dist/api/config.js +5 -4
- package/dist/api/environments.js +5 -1
- package/dist/api/processor.js +4 -1
- package/dist/app/EnvironmentEmbedRoot.js +22 -30
- package/dist/components/ai-elements/code-block.js +4 -4
- package/dist/components/dynamic-form/CodeContent.js +1 -1
- package/dist/components/dynamic-form/FormBody.js +1 -1
- package/dist/components/motion/FadeIn.js +72 -0
- package/dist/components/motion/StreamingText.js +49 -0
- package/dist/components/ui/accordion.js +2 -2
- package/dist/components/ui-widgets/UiWidget.js +11 -10
- package/dist/components/ui-widgets/widgets/AiPromptInput.js +31 -28
- package/dist/events/sse-client-events.js +7 -1
- package/dist/features/code-explorer/components/FileContentViewer.js +2 -2
- package/dist/features/debug/components/WorkflowFlowViewer.js +49 -51
- package/dist/features/documents/DocumentRenderer.js +18 -17
- package/dist/features/documents/components/DocumentItem.js +42 -20
- package/dist/features/documents/components/DocumentList.js +34 -36
- package/dist/features/documents/components/DocumentMetadataPills.js +102 -49
- package/dist/features/documents/document-details/DocumentDetails.js +577 -377
- package/dist/features/documents/document-details/PromptDetails.js +118 -130
- package/dist/features/documents/document-details/document-debug-utils.js +100 -0
- package/dist/features/documents/renderers/ChoicesRenderer.js +41 -38
- package/dist/features/documents/renderers/ConfirmPromptRenderer.js +31 -28
- package/dist/features/documents/renderers/DocumentFormRenderer.js +62 -70
- package/dist/features/documents/renderers/LlmMessage.js +52 -47
- package/dist/features/documents/renderers/TextPromptRenderer.js +32 -29
- package/dist/features/documents/renderers/useDocumentTransition.js +4 -4
- package/dist/features/feature-registry/FeatureRegistryProvider.js +32 -10
- package/dist/features/feature-registry/available-features.js +12 -0
- package/dist/features/feature-registry/index.js +2 -1
- package/dist/features/file-explorer/components/FileExplorerPanel.js +55 -51
- package/dist/features/git/components/GitBranchBadge.js +31 -0
- package/dist/features/git/components/GitCommitList.js +46 -0
- package/dist/features/git/components/GitRemoteStatus.js +84 -0
- package/dist/features/git/components/WorkbenchGitPanel.js +81 -0
- package/dist/features/git/git-feature.js +12 -0
- package/dist/features/git/hooks/useGit.js +78 -0
- package/dist/features/git/index.js +1 -0
- package/dist/features/oauth/OAuthPromptRenderer.js +137 -142
- package/dist/features/runs/Runs.js +4 -4
- package/dist/features/secrets/components/WorkbenchSecretsPanel.js +1 -1
- package/dist/features/secrets/renderers/SecretInputRenderer.js +30 -29
- package/dist/features/workbench/Workbench.js +25 -33
- package/dist/features/workbench/WorkflowItem.js +9 -9
- package/dist/features/workbench/WorkflowList.js +61 -62
- package/dist/features/workbench/components/NewRunDialog.js +237 -209
- package/dist/features/workbench/components/RecentRunItem.js +3 -3
- package/dist/features/workbench/components/WorkbenchEnvironmentPanel.js +8 -8
- package/dist/features/workbench/components/WorkbenchIconSidebar.js +1 -1
- package/dist/features/workbench/components/WorkbenchSidebarShell.js +3 -3
- package/dist/features/workbench/components/WorkflowForms.js +11 -10
- package/dist/features/workbench/components/WorkflowHistoryItem.js +16 -36
- package/dist/features/workbench/components/WorkflowHistoryList.js +19 -17
- package/dist/features/workbench/components/buttons/WorkflowButtons.js +3 -3
- package/dist/features/workbench/hooks/useLlmStreamingDocuments.js +159 -0
- package/dist/features/workbench/hooks/useWorkflowData.js +58 -31
- package/dist/features/workbench/index.js +2 -2
- package/dist/features/workbench/providers/WorkbenchLayoutProvider.js +53 -53
- package/dist/features/workspaces/Workspaces.js +134 -125
- package/dist/features/workspaces/components/CreateWorkspace.js +115 -107
- package/dist/features/workspaces/components/ExecutionTimeline.js +2 -2
- package/dist/features/workspaces/components/WorkflowRunForm.js +127 -104
- package/dist/features/workspaces/components/WorkspaceHomePage.js +6 -89
- package/dist/features/workspaces/components/workflow-form/ArgumentsView.js +1 -1
- package/dist/features/workspaces/components/workflow-form/SelectionView.js +15 -15
- package/dist/hooks/index.js +3 -2
- package/dist/hooks/query-keys.js +43 -30
- package/dist/hooks/useConfig.js +28 -22
- package/dist/hooks/useEnvironments.js +27 -2
- package/dist/hooks/useProcessor.js +14 -1
- package/dist/hooks/useWorkflows.js +4 -4
- package/dist/index.d.ts +116 -15
- package/dist/index.js +9 -8
- package/dist/node_modules/d3/src/index.js +13 -13
- package/dist/node_modules/d3-scale/src/continuous.js +16 -16
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-3BPJPVTR.js +43 -43
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-GPEHLZMM.js +270 -270
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-AAUBKEIU.js +90 -90
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-3OPIFGDE.js +458 -458
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-55IACEB6.js +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5ZQYHXKU.js +37 -37
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-727SXJPM.js +208 -208
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-KSCS5N6A.js +145 -145
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ND2GUHAM.js +7 -7
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-O5CBEL6O.js +41 -41
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-WU5MYG2G.js +3 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/cose-bilkent-S5V4N54A.js +6 -6
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-KO2AKTUF.js +30 -30
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-OG6HWLK6.js +82 -82
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/erDiagram-TEJ5UH35.js +65 -65
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-I6XJVG4X.js +227 -227
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-6RSMTGT7.js +104 -104
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-PVQCEYII.js +104 -104
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/journeyDiagram-JHISSGLW.js +49 -49
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/quadrantDiagram-W4KKPZXB.js +101 -101
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sankeyDiagram-5OEKKPKP.js +20 -20
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-3UESZ5HK.js +354 -354
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-AJRCARHV.js +53 -53
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-PNZ67QCA.js +113 -113
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-CIIHVFJN.js +90 -90
- package/dist/node_modules/mermaid/dist/mermaid.core.js +156 -156
- package/dist/node_modules/motion/dist/es/react.js +9 -2
- package/dist/pages/DebugWorkflowDetailsPage.js +2 -2
- package/dist/pages/DebugWorkflowsPage.js +76 -106
- package/dist/pages/EmbedWorkbenchPage.js +1 -1
- package/dist/pages/PreviewWorkbenchPage.js +6 -6
- package/dist/pages/WorkbenchPage.js +43 -47
- package/dist/pages/WorkflowDebugPage.js +6 -12
- package/dist/pages/WorkspacePage.js +40 -66
- package/dist/pages/WorkspaceRunsPage.js +24 -31
- package/package.json +2 -2
|
@@ -1,95 +1,99 @@
|
|
|
1
|
-
import { useWorkbenchLayout } from "../../workbench/providers/WorkbenchLayoutProvider.js";
|
|
2
|
-
import { SidebarPanel } from "../../workbench/components/SidebarPanel.js";
|
|
3
|
-
import "../../workbench/index.js";
|
|
4
1
|
import { FileContentViewer } from "../../code-explorer/components/FileContentViewer.js";
|
|
5
2
|
import "../../code-explorer/index.js";
|
|
3
|
+
import { useWorkbenchLayout } from "../../workbench/providers/WorkbenchLayoutProvider.js";
|
|
4
|
+
import "../../workbench/index.js";
|
|
5
|
+
import { SidebarPanel } from "../../workbench/components/SidebarPanel.js";
|
|
6
6
|
import { FileExplorerProvider, useOptionalFileExplorer } from "../providers/FileExplorerProvider.js";
|
|
7
7
|
import { FileTabsBar } from "./FileTabsBar.js";
|
|
8
8
|
import { FileTree } from "./FileTree.js";
|
|
9
|
+
import { useFeatureConfig } from "../../feature-registry/FeatureRegistryProvider.js";
|
|
10
|
+
import "../../feature-registry/index.js";
|
|
9
11
|
import { c } from "react/compiler-runtime";
|
|
10
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
13
|
import { Files } from "lucide-react";
|
|
12
14
|
function FileExplorerContent() {
|
|
13
|
-
let
|
|
14
|
-
if (!
|
|
15
|
-
let
|
|
16
|
-
return
|
|
15
|
+
let i = c(7), a = useOptionalFileExplorer();
|
|
16
|
+
if (!a) {
|
|
17
|
+
let e;
|
|
18
|
+
return i[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx("div", {
|
|
17
19
|
className: "flex flex-1 items-center justify-center p-4",
|
|
18
20
|
children: /* @__PURE__ */ jsx("p", {
|
|
19
21
|
className: "text-muted-foreground text-sm",
|
|
20
22
|
children: "File explorer is not available for this workspace."
|
|
21
23
|
})
|
|
22
|
-
}),
|
|
24
|
+
}), i[0] = e) : e = i[0], e;
|
|
23
25
|
}
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
+
let o;
|
|
27
|
+
i[1] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ jsx("div", {
|
|
26
28
|
className: "w-52 shrink-0 overflow-auto border-r bg-muted/40",
|
|
27
29
|
children: /* @__PURE__ */ jsx(FileTree, {})
|
|
28
|
-
}),
|
|
30
|
+
}), i[1] = o) : o = i[1];
|
|
29
31
|
let d;
|
|
30
|
-
|
|
31
|
-
let
|
|
32
|
-
return
|
|
32
|
+
i[2] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ jsx(FileTabsBar, {}), i[2] = d) : d = i[2];
|
|
33
|
+
let p;
|
|
34
|
+
return i[3] !== a.fileContent || i[4] !== a.isContentLoading || i[5] !== a.selectedFile ? (p = /* @__PURE__ */ jsxs("div", {
|
|
33
35
|
className: "flex h-full",
|
|
34
|
-
children: [
|
|
36
|
+
children: [o, /* @__PURE__ */ jsxs("div", {
|
|
35
37
|
className: "flex min-w-0 flex-1 flex-col",
|
|
36
38
|
children: [d, /* @__PURE__ */ jsx("div", {
|
|
37
39
|
className: "flex-1 overflow-hidden p-3 pt-2",
|
|
38
40
|
children: /* @__PURE__ */ jsx(FileContentViewer, {
|
|
39
|
-
selectedFile:
|
|
40
|
-
content:
|
|
41
|
-
isLoading:
|
|
41
|
+
selectedFile: a.selectedFile,
|
|
42
|
+
content: a.fileContent,
|
|
43
|
+
isLoading: a.isContentLoading,
|
|
42
44
|
className: "h-full"
|
|
43
45
|
})
|
|
44
46
|
})]
|
|
45
47
|
})]
|
|
46
|
-
}),
|
|
48
|
+
}), i[3] = a.fileContent, i[4] = a.isContentLoading, i[5] = a.selectedFile, i[6] = p) : p = i[6], p;
|
|
47
49
|
}
|
|
48
|
-
function FileExplorerPanel(
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
let _ =
|
|
52
|
-
|
|
50
|
+
function FileExplorerPanel(e) {
|
|
51
|
+
let s = c(21), { workspaceId: l } = e, { closePanel: u, panelSize: f, setPanelSize: m, environments: h } = useWorkbenchLayout(), g = useFeatureConfig("fileExplorer"), _;
|
|
52
|
+
s[0] === g?.config?.environments ? _ = s[1] : (_ = g?.config?.environments ?? [], s[0] = g?.config?.environments, s[1] = _);
|
|
53
|
+
let v = _, y = h?.[0]?.slotId ?? "", b;
|
|
54
|
+
s[2] !== v || s[3] !== y ? (b = v.length === 0 || v.includes(y), s[2] = v, s[3] = y, s[4] = b) : b = s[4];
|
|
55
|
+
let x = b;
|
|
56
|
+
if (!x) {
|
|
53
57
|
let e;
|
|
54
|
-
|
|
58
|
+
s[5] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx(Files, { className: "h-4 w-4" }), s[5] = e) : e = s[5];
|
|
55
59
|
let i;
|
|
56
|
-
|
|
60
|
+
s[6] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ jsx("div", {
|
|
57
61
|
className: "flex flex-1 items-center justify-center p-4",
|
|
58
62
|
children: /* @__PURE__ */ jsx("p", {
|
|
59
63
|
className: "text-muted-foreground text-sm",
|
|
60
64
|
children: "File explorer is not available for this environment."
|
|
61
65
|
})
|
|
62
|
-
}),
|
|
63
|
-
let
|
|
64
|
-
return
|
|
66
|
+
}), s[6] = i) : i = s[6];
|
|
67
|
+
let o;
|
|
68
|
+
return s[7] !== u || s[8] !== f || s[9] !== m ? (o = /* @__PURE__ */ jsx(SidebarPanel, {
|
|
65
69
|
icon: e,
|
|
66
70
|
title: "Files",
|
|
67
71
|
description: "Browse remote files.",
|
|
68
|
-
size:
|
|
69
|
-
onSizeChange:
|
|
70
|
-
onClose:
|
|
72
|
+
size: f,
|
|
73
|
+
onSizeChange: m,
|
|
74
|
+
onClose: u,
|
|
71
75
|
children: i
|
|
72
|
-
}),
|
|
76
|
+
}), s[7] = u, s[8] = f, s[9] = m, s[10] = o) : o = s[10], o;
|
|
73
77
|
}
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
-
let
|
|
77
|
-
|
|
78
|
-
let
|
|
79
|
-
|
|
80
|
-
workspaceId:
|
|
81
|
-
enabled:
|
|
82
|
-
children:
|
|
83
|
-
}),
|
|
84
|
-
let
|
|
85
|
-
return
|
|
86
|
-
icon:
|
|
78
|
+
let S;
|
|
79
|
+
s[11] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ jsx(Files, { className: "h-4 w-4" }), s[11] = S) : S = s[11];
|
|
80
|
+
let C;
|
|
81
|
+
s[12] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ jsx(FileExplorerContent, {}), s[12] = C) : C = s[12];
|
|
82
|
+
let w;
|
|
83
|
+
s[13] !== x || s[14] !== l ? (w = /* @__PURE__ */ jsx(FileExplorerProvider, {
|
|
84
|
+
workspaceId: l,
|
|
85
|
+
enabled: x,
|
|
86
|
+
children: C
|
|
87
|
+
}), s[13] = x, s[14] = l, s[15] = w) : w = s[15];
|
|
88
|
+
let T;
|
|
89
|
+
return s[16] !== u || s[17] !== f || s[18] !== m || s[19] !== w ? (T = /* @__PURE__ */ jsx(SidebarPanel, {
|
|
90
|
+
icon: S,
|
|
87
91
|
title: "Files",
|
|
88
92
|
description: "Browse and view files.",
|
|
89
|
-
size:
|
|
90
|
-
onSizeChange:
|
|
91
|
-
onClose:
|
|
92
|
-
children:
|
|
93
|
-
}),
|
|
93
|
+
size: f,
|
|
94
|
+
onSizeChange: m,
|
|
95
|
+
onClose: u,
|
|
96
|
+
children: w
|
|
97
|
+
}), s[16] = u, s[17] = f, s[18] = m, s[19] = w, s[20] = T) : T = s[20], T;
|
|
94
98
|
}
|
|
95
99
|
export { FileExplorerPanel };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { GitBranch } from "lucide-react";
|
|
4
|
+
function GitBranchBadge(i) {
|
|
5
|
+
let a = c(8), { status: o } = i, s = o.staged.length + o.modified.length + o.untracked.length + o.deleted.length, l;
|
|
6
|
+
a[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ jsx(GitBranch, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), a[0] = l) : l = a[0];
|
|
7
|
+
let u;
|
|
8
|
+
a[1] === o.branch ? u = a[2] : (u = /* @__PURE__ */ jsx("span", {
|
|
9
|
+
className: "font-mono text-sm font-medium",
|
|
10
|
+
children: o.branch
|
|
11
|
+
}), a[1] = o.branch, a[2] = u);
|
|
12
|
+
let d;
|
|
13
|
+
a[3] === s ? d = a[4] : (d = s > 0 && /* @__PURE__ */ jsxs("span", {
|
|
14
|
+
className: "text-muted-foreground text-xs",
|
|
15
|
+
children: [
|
|
16
|
+
s,
|
|
17
|
+
" change",
|
|
18
|
+
s === 1 ? "" : "s"
|
|
19
|
+
]
|
|
20
|
+
}), a[3] = s, a[4] = d);
|
|
21
|
+
let f;
|
|
22
|
+
return a[5] !== u || a[6] !== d ? (f = /* @__PURE__ */ jsxs("div", {
|
|
23
|
+
className: "flex items-center gap-2 rounded-md bg-muted/50 px-3 py-2",
|
|
24
|
+
children: [
|
|
25
|
+
l,
|
|
26
|
+
u,
|
|
27
|
+
d
|
|
28
|
+
]
|
|
29
|
+
}), a[5] = u, a[6] = d, a[7] = f) : f = a[7], f;
|
|
30
|
+
}
|
|
31
|
+
export { GitBranchBadge };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
function formatRelativeTime(e) {
|
|
4
|
+
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4), i = Math.floor(n / 36e5), a = Math.floor(n / 864e5);
|
|
5
|
+
return r < 1 ? "just now" : r < 60 ? `${r}m ago` : i < 24 ? `${i}h ago` : a < 30 ? `${a}d ago` : t.toLocaleDateString();
|
|
6
|
+
}
|
|
7
|
+
function GitCommitList(n) {
|
|
8
|
+
let r = c(5), { commits: i } = n;
|
|
9
|
+
if (i.length === 0) {
|
|
10
|
+
let e;
|
|
11
|
+
return r[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ jsx("p", {
|
|
12
|
+
className: "text-muted-foreground py-4 text-center text-sm",
|
|
13
|
+
children: "No commits yet."
|
|
14
|
+
}), r[0] = e) : e = r[0], e;
|
|
15
|
+
}
|
|
16
|
+
let o;
|
|
17
|
+
r[1] === i ? o = r[2] : (o = i.map(_temp), r[1] = i, r[2] = o);
|
|
18
|
+
let s;
|
|
19
|
+
return r[3] === o ? s = r[4] : (s = /* @__PURE__ */ jsx("div", {
|
|
20
|
+
className: "space-y-1.5",
|
|
21
|
+
children: o
|
|
22
|
+
}), r[3] = o, r[4] = s), s;
|
|
23
|
+
}
|
|
24
|
+
function _temp(e) {
|
|
25
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
26
|
+
className: "rounded-md bg-muted/50 px-3 py-2",
|
|
27
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: "flex items-start gap-2",
|
|
29
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
30
|
+
className: "font-mono text-xs text-muted-foreground shrink-0",
|
|
31
|
+
children: e.shortHash
|
|
32
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
33
|
+
className: "text-sm leading-tight line-clamp-2",
|
|
34
|
+
children: e.message
|
|
35
|
+
})]
|
|
36
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
37
|
+
className: "mt-1 flex items-center gap-2 text-xs text-muted-foreground",
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ jsx("span", { children: e.author }),
|
|
40
|
+
/* @__PURE__ */ jsx("span", { children: "·" }),
|
|
41
|
+
/* @__PURE__ */ jsx("span", { children: formatRelativeTime(e.date) })
|
|
42
|
+
]
|
|
43
|
+
})]
|
|
44
|
+
}, e.hash);
|
|
45
|
+
}
|
|
46
|
+
export { GitCommitList };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Button } from "../../../components/ui/button.js";
|
|
2
|
+
import ConfirmDialog_default from "../../../components/data-table/ConfirmDialog.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { GitFork, Loader2, Plus, Trash2 } from "lucide-react";
|
|
7
|
+
function parseGitHubUrl(r) {
|
|
8
|
+
let u = r.match(/github\.com[/:]([^/]+\/[^/.]+)/);
|
|
9
|
+
return u ? u[1] : null;
|
|
10
|
+
}
|
|
11
|
+
function GitRemoteStatus(p) {
|
|
12
|
+
let m = c(27), { remote: h, onConnect: g, isConnecting: _, onRemove: v, isRemoving: y } = p, [b, x] = useState(!1);
|
|
13
|
+
if (!h) {
|
|
14
|
+
let u;
|
|
15
|
+
m[0] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ jsx("div", {
|
|
16
|
+
className: "text-muted-foreground px-3 py-2 text-sm",
|
|
17
|
+
children: "No remote configured"
|
|
18
|
+
}), m[0] = u) : u = m[0];
|
|
19
|
+
let d;
|
|
20
|
+
m[1] !== _ || m[2] !== g ? (d = g && /* @__PURE__ */ jsxs(Button, {
|
|
21
|
+
size: "sm",
|
|
22
|
+
variant: "outline",
|
|
23
|
+
className: "w-full",
|
|
24
|
+
onClick: g,
|
|
25
|
+
disabled: _,
|
|
26
|
+
children: [_ ? /* @__PURE__ */ jsx(Loader2, { className: "mr-1 h-3 w-3 animate-spin" }) : /* @__PURE__ */ jsx(Plus, { className: "mr-1 h-3 w-3" }), "Connect to GitHub"]
|
|
27
|
+
}), m[1] = _, m[2] = g, m[3] = d) : d = m[3];
|
|
28
|
+
let f;
|
|
29
|
+
return m[4] === d ? f = m[5] : (f = /* @__PURE__ */ jsxs("div", {
|
|
30
|
+
className: "space-y-2",
|
|
31
|
+
children: [u, d]
|
|
32
|
+
}), m[4] = d, m[5] = f), f;
|
|
33
|
+
}
|
|
34
|
+
let S;
|
|
35
|
+
m[6] === h.url ? S = m[7] : (S = parseGitHubUrl(h.url), m[6] = h.url, m[7] = S);
|
|
36
|
+
let C = S, w;
|
|
37
|
+
m[8] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ jsx(GitFork, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), m[8] = w) : w = m[8];
|
|
38
|
+
let T;
|
|
39
|
+
m[9] !== h.url || m[10] !== C ? (T = /* @__PURE__ */ jsx("div", {
|
|
40
|
+
className: "min-w-0 flex-1",
|
|
41
|
+
children: C ? /* @__PURE__ */ jsx("span", {
|
|
42
|
+
className: "font-mono text-sm",
|
|
43
|
+
children: C
|
|
44
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
45
|
+
className: "truncate text-sm text-muted-foreground",
|
|
46
|
+
children: h.url
|
|
47
|
+
})
|
|
48
|
+
}), m[9] = h.url, m[10] = C, m[11] = T) : T = m[11];
|
|
49
|
+
let E;
|
|
50
|
+
m[12] !== y || m[13] !== v ? (E = v && /* @__PURE__ */ jsx(Button, {
|
|
51
|
+
size: "sm",
|
|
52
|
+
variant: "ghost",
|
|
53
|
+
className: "h-7 shrink-0",
|
|
54
|
+
onClick: () => x(!0),
|
|
55
|
+
disabled: y,
|
|
56
|
+
children: y ? /* @__PURE__ */ jsx(Loader2, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ jsx(Trash2, { className: "h-3 w-3" })
|
|
57
|
+
}), m[12] = y, m[13] = v, m[14] = E) : E = m[14];
|
|
58
|
+
let D;
|
|
59
|
+
m[15] !== T || m[16] !== E ? (D = /* @__PURE__ */ jsxs("div", {
|
|
60
|
+
className: "flex items-center gap-2 rounded-md bg-muted/50 px-3 py-2",
|
|
61
|
+
children: [
|
|
62
|
+
w,
|
|
63
|
+
T,
|
|
64
|
+
E
|
|
65
|
+
]
|
|
66
|
+
}), m[15] = T, m[16] = E, m[17] = D) : D = m[17];
|
|
67
|
+
let O = `This will disconnect the remote "${h.name}" (${C ?? h.url}). The repository on GitHub will not be deleted.`, k;
|
|
68
|
+
m[18] === v ? k = m[19] : (k = () => {
|
|
69
|
+
x(!1), v?.();
|
|
70
|
+
}, m[18] = v, m[19] = k);
|
|
71
|
+
let A;
|
|
72
|
+
m[20] !== b || m[21] !== O || m[22] !== k ? (A = /* @__PURE__ */ jsx(ConfirmDialog_default, {
|
|
73
|
+
isOpen: b,
|
|
74
|
+
onOpenChange: x,
|
|
75
|
+
title: "Remove remote",
|
|
76
|
+
description: O,
|
|
77
|
+
confirmText: "Remove",
|
|
78
|
+
variant: "destructive",
|
|
79
|
+
onConfirm: k
|
|
80
|
+
}), m[20] = b, m[21] = O, m[22] = k, m[23] = A) : A = m[23];
|
|
81
|
+
let j;
|
|
82
|
+
return m[24] !== D || m[25] !== A ? (j = /* @__PURE__ */ jsxs(Fragment$1, { children: [D, A] }), m[24] = D, m[25] = A, m[26] = j) : j = m[26], j;
|
|
83
|
+
}
|
|
84
|
+
export { GitRemoteStatus };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { useStudio } from "../../../providers/StudioProvider.js";
|
|
2
|
+
import { useCreateWorkflow } from "../../../hooks/useWorkflows.js";
|
|
3
|
+
import { useRunWorkflow } from "../../../hooks/useProcessor.js";
|
|
4
|
+
import { useWorkbenchLayout } from "../../workbench/providers/WorkbenchLayoutProvider.js";
|
|
5
|
+
import "../../workbench/index.js";
|
|
6
|
+
import { SidebarPanel } from "../../workbench/components/SidebarPanel.js";
|
|
7
|
+
import { useGitInvalidation, useGitLog, useGitRemote, useGitStatus, useRemoveGitRemote } from "../hooks/useGit.js";
|
|
8
|
+
import { GitBranchBadge } from "./GitBranchBadge.js";
|
|
9
|
+
import { GitCommitList } from "./GitCommitList.js";
|
|
10
|
+
import { GitRemoteStatus } from "./GitRemoteStatus.js";
|
|
11
|
+
import { c } from "react/compiler-runtime";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { GitBranch, Loader2 } from "lucide-react";
|
|
14
|
+
function WorkbenchGitPanel(y) {
|
|
15
|
+
let b = c(20), { workspaceId: x } = y, { panelSize: S, setPanelSize: C, closePanel: w } = useWorkbenchLayout(), { router: T } = useStudio(), { data: E, isLoading: D } = useGitStatus(x), { data: O, isLoading: k } = useGitLog(x), { data: A } = useGitRemote(x);
|
|
16
|
+
useGitInvalidation(x);
|
|
17
|
+
let j = useCreateWorkflow(), M = useRunWorkflow(), N = useRemoveGitRemote(), P = j.isPending || M.isPending, F;
|
|
18
|
+
b[0] !== j || b[1] !== T || b[2] !== M || b[3] !== x ? (F = () => {
|
|
19
|
+
x && j.mutate({ workflowCreateDto: {
|
|
20
|
+
workflowName: "connectGitHub",
|
|
21
|
+
title: null,
|
|
22
|
+
workspaceId: x,
|
|
23
|
+
transition: null,
|
|
24
|
+
args: {}
|
|
25
|
+
} }, { onSuccess: (t) => {
|
|
26
|
+
M.mutate({
|
|
27
|
+
workflowId: t.id,
|
|
28
|
+
runWorkflowPayloadDto: {},
|
|
29
|
+
force: !0
|
|
30
|
+
}, { onSuccess: () => {
|
|
31
|
+
T.navigateToWorkflow(t.id);
|
|
32
|
+
} });
|
|
33
|
+
} });
|
|
34
|
+
}, b[0] = j, b[1] = T, b[2] = M, b[3] = x, b[4] = F) : F = b[4];
|
|
35
|
+
let I = F, L = D || k, R;
|
|
36
|
+
b[5] === Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ jsx(GitBranch, { className: "h-4 w-4" }), b[5] = R) : R = b[5];
|
|
37
|
+
let z;
|
|
38
|
+
b[6] !== I || b[7] !== P || b[8] !== L || b[9] !== O?.commits || b[10] !== A || b[11] !== N || b[12] !== E || b[13] !== x ? (z = /* @__PURE__ */ jsx("div", {
|
|
39
|
+
className: "flex h-full flex-col",
|
|
40
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
41
|
+
className: "flex-1 overflow-y-auto px-4 py-3",
|
|
42
|
+
children: L ? /* @__PURE__ */ jsxs("div", {
|
|
43
|
+
className: "flex items-center gap-2 py-4",
|
|
44
|
+
children: [/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), /* @__PURE__ */ jsx("span", {
|
|
45
|
+
className: "text-muted-foreground text-sm",
|
|
46
|
+
children: "Loading..."
|
|
47
|
+
})]
|
|
48
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
49
|
+
className: "space-y-4",
|
|
50
|
+
children: [
|
|
51
|
+
E && /* @__PURE__ */ jsx(GitBranchBadge, { status: E }),
|
|
52
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h4", {
|
|
53
|
+
className: "mb-2 text-xs font-medium uppercase text-muted-foreground",
|
|
54
|
+
children: "Remote"
|
|
55
|
+
}), /* @__PURE__ */ jsx(GitRemoteStatus, {
|
|
56
|
+
remote: A,
|
|
57
|
+
onConnect: I,
|
|
58
|
+
isConnecting: P,
|
|
59
|
+
onRemove: x ? () => N.mutate({ workspaceId: x }) : void 0,
|
|
60
|
+
isRemoving: N.isPending
|
|
61
|
+
})] }),
|
|
62
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h4", {
|
|
63
|
+
className: "mb-2 text-xs font-medium uppercase text-muted-foreground",
|
|
64
|
+
children: "Recent Commits"
|
|
65
|
+
}), /* @__PURE__ */ jsx(GitCommitList, { commits: O?.commits ?? [] })] })
|
|
66
|
+
]
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
}), b[6] = I, b[7] = P, b[8] = L, b[9] = O?.commits, b[10] = A, b[11] = N, b[12] = E, b[13] = x, b[14] = z) : z = b[14];
|
|
70
|
+
let B;
|
|
71
|
+
return b[15] !== w || b[16] !== S || b[17] !== C || b[18] !== z ? (B = /* @__PURE__ */ jsx(SidebarPanel, {
|
|
72
|
+
icon: R,
|
|
73
|
+
title: "Git",
|
|
74
|
+
description: "Source control for this workspace.",
|
|
75
|
+
size: S,
|
|
76
|
+
onSizeChange: C,
|
|
77
|
+
onClose: w,
|
|
78
|
+
children: z
|
|
79
|
+
}), b[15] = w, b[16] = S, b[17] = C, b[18] = z, b[19] = B) : B = b[19], B;
|
|
80
|
+
}
|
|
81
|
+
export { WorkbenchGitPanel };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { WorkbenchGitPanel } from "./components/WorkbenchGitPanel.js";
|
|
2
|
+
import { GitBranch } from "lucide-react";
|
|
3
|
+
const gitFeature = {
|
|
4
|
+
id: "git",
|
|
5
|
+
sidebarPanel: {
|
|
6
|
+
id: "git",
|
|
7
|
+
label: "Git",
|
|
8
|
+
icon: GitBranch,
|
|
9
|
+
component: WorkbenchGitPanel
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
export { gitFeature };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { getGitLogCacheKey, getGitRemoteCacheKey, getGitStatusCacheKey } from "../../../hooks/query-keys.js";
|
|
2
|
+
import { eventBus } from "../../../services/eventEmitter.js";
|
|
3
|
+
import "../../../services/index.js";
|
|
4
|
+
import { useApiClient } from "../../../hooks/useApi.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
6
|
+
import { useEffect } from "react";
|
|
7
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
8
|
+
function useGitStatus(e) {
|
|
9
|
+
let i = c(10), { envKey: o, api: s } = useApiClient(), l;
|
|
10
|
+
i[0] !== o || i[1] !== e ? (l = getGitStatusCacheKey(o, e), i[0] = o, i[1] = e, i[2] = l) : l = i[2];
|
|
11
|
+
let d;
|
|
12
|
+
i[3] !== s || i[4] !== e ? (d = () => s.git.getStatus({ workspaceId: e }), i[3] = s, i[4] = e, i[5] = d) : d = i[5];
|
|
13
|
+
let f = !!e, p;
|
|
14
|
+
return i[6] !== l || i[7] !== d || i[8] !== f ? (p = {
|
|
15
|
+
queryKey: l,
|
|
16
|
+
queryFn: d,
|
|
17
|
+
enabled: f,
|
|
18
|
+
staleTime: 3e4,
|
|
19
|
+
retry: !1
|
|
20
|
+
}, i[6] = l, i[7] = d, i[8] = f, i[9] = p) : p = i[9], useQuery(p);
|
|
21
|
+
}
|
|
22
|
+
function useGitLog(i, a) {
|
|
23
|
+
let o = c(11), s = a === void 0 ? 50 : a, { envKey: l, api: d } = useApiClient(), f;
|
|
24
|
+
o[0] !== l || o[1] !== i ? (f = getGitLogCacheKey(l, i), o[0] = l, o[1] = i, o[2] = f) : f = o[2];
|
|
25
|
+
let p;
|
|
26
|
+
o[3] !== d || o[4] !== s || o[5] !== i ? (p = () => d.git.getLog({
|
|
27
|
+
workspaceId: i,
|
|
28
|
+
limit: s
|
|
29
|
+
}), o[3] = d, o[4] = s, o[5] = i, o[6] = p) : p = o[6];
|
|
30
|
+
let m = !!i, h;
|
|
31
|
+
return o[7] !== f || o[8] !== p || o[9] !== m ? (h = {
|
|
32
|
+
queryKey: f,
|
|
33
|
+
queryFn: p,
|
|
34
|
+
enabled: m,
|
|
35
|
+
staleTime: 3e4,
|
|
36
|
+
retry: !1
|
|
37
|
+
}, o[7] = f, o[8] = p, o[9] = m, o[10] = h) : h = o[10], useQuery(h);
|
|
38
|
+
}
|
|
39
|
+
function useGitRemote(e) {
|
|
40
|
+
let a = c(10), { envKey: o, api: s } = useApiClient(), l;
|
|
41
|
+
a[0] !== o || a[1] !== e ? (l = getGitRemoteCacheKey(o, e), a[0] = o, a[1] = e, a[2] = l) : l = a[2];
|
|
42
|
+
let d;
|
|
43
|
+
a[3] !== s || a[4] !== e ? (d = () => s.git.getRemote({ workspaceId: e }), a[3] = s, a[4] = e, a[5] = d) : d = a[5];
|
|
44
|
+
let f = !!e, p;
|
|
45
|
+
return a[6] !== l || a[7] !== d || a[8] !== f ? (p = {
|
|
46
|
+
queryKey: l,
|
|
47
|
+
queryFn: d,
|
|
48
|
+
enabled: f,
|
|
49
|
+
staleTime: 6e4,
|
|
50
|
+
retry: !1
|
|
51
|
+
}, a[6] = l, a[7] = d, a[8] = f, a[9] = p) : p = a[9], useQuery(p);
|
|
52
|
+
}
|
|
53
|
+
function useGitInvalidation(l) {
|
|
54
|
+
let u = c(5), { envKey: f } = useApiClient(), p = useQueryClient(), m, h;
|
|
55
|
+
u[0] !== f || u[1] !== p || u[2] !== l ? (m = () => {
|
|
56
|
+
if (l) return eventBus.on("git.updated", (o) => {
|
|
57
|
+
o.workspaceId === l && (p.invalidateQueries({ queryKey: getGitStatusCacheKey(f, l) }), p.invalidateQueries({ queryKey: getGitLogCacheKey(f, l) }), p.invalidateQueries({ queryKey: getGitRemoteCacheKey(f, l) }));
|
|
58
|
+
});
|
|
59
|
+
}, h = [
|
|
60
|
+
f,
|
|
61
|
+
l,
|
|
62
|
+
p
|
|
63
|
+
], u[0] = f, u[1] = p, u[2] = l, u[3] = m, u[4] = h) : (m = u[3], h = u[4]), useEffect(m, h);
|
|
64
|
+
}
|
|
65
|
+
function useRemoveGitRemote() {
|
|
66
|
+
let e = c(8), { envKey: a, api: o } = useApiClient(), s = useQueryClient(), u;
|
|
67
|
+
e[0] === o ? u = e[1] : (u = (e) => o.git.removeRemote(e), e[0] = o, e[1] = u);
|
|
68
|
+
let f;
|
|
69
|
+
e[2] !== a || e[3] !== s ? (f = (e, o) => {
|
|
70
|
+
s.invalidateQueries({ queryKey: getGitRemoteCacheKey(a, o.workspaceId) });
|
|
71
|
+
}, e[2] = a, e[3] = s, e[4] = f) : f = e[4];
|
|
72
|
+
let p;
|
|
73
|
+
return e[5] !== u || e[6] !== f ? (p = {
|
|
74
|
+
mutationFn: u,
|
|
75
|
+
onSuccess: f
|
|
76
|
+
}, e[5] = u, e[6] = f, e[7] = p) : p = e[7], useMutation(p);
|
|
77
|
+
}
|
|
78
|
+
export { useGitInvalidation, useGitLog, useGitRemote, useGitStatus, useRemoveGitRemote };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { gitFeature } from "./git-feature.js";
|