@neuralnomads/codenomad-dev 0.15.0-dev-20260505-ecfbc9e5 → 0.15.0-dev-20260509-71531697
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/filesystem/__tests__/browser.test.js +65 -0
- package/dist/filesystem/__tests__/search-cache.test.js +2 -2
- package/dist/filesystem/browser.js +4 -4
- package/dist/server/routes/workspaces.js +21 -0
- package/dist/workspaces/__tests__/git-clone.test.js +141 -0
- package/dist/workspaces/git-clone.js +148 -0
- package/package.json +1 -1
- package/public/assets/{ChangesTab-D5xHzBll.js → ChangesTab-CnpuqxE4.js} +2 -2
- package/public/assets/{DiffToolbar-Cj8j07BO.js → DiffToolbar-CNfiD6cp.js} +1 -1
- package/public/assets/{FilesTab-B3rxz4Vf.js → FilesTab-Bkn2Glaq.js} +2 -2
- package/public/assets/GitChangesTab-D5kJ45cq.js +2 -0
- package/public/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/public/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/public/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/public/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/public/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/public/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/public/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/public/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/public/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/public/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/public/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/public/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/public/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/public/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/public/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/public/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/public/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/public/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/public/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/public/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/public/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/public/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/public/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/public/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/public/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/public/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/public/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/public/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/public/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/public/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/public/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/public/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/public/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/public/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/public/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/public/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/public/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/public/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/public/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/public/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/public/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/public/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/public/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/public/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/public/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/public/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/public/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/public/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/public/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/public/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/public/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/public/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/public/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/public/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/public/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/public/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/public/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/public/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/public/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/public/assets/{SplitFilePanel-BOHH3F--.js → SplitFilePanel-DMnUqWnk.js} +1 -1
- package/public/assets/StatusTab-DgvQQ67G.js +1 -0
- package/public/assets/{align-justify-sjJoOhms.js → align-justify-pBFgPIct.js} +1 -1
- package/public/assets/{bundle-full-xFW13Lny.js → bundle-full-CAX-gm_x.js} +1 -1
- package/public/assets/{diff-viewer-Bd-44Zzf.js → diff-viewer-hE2nGS5H.js} +1 -1
- package/public/assets/index-BHFt2rWX.js +1 -0
- package/public/assets/{index-CCAZZY0l.js → index-BJHLw6jN.js} +1 -1
- package/public/assets/index-Bv35Fv-v.js +2 -0
- package/public/assets/index-CFwfPYqZ.js +1 -0
- package/public/assets/index-CNMyfcAf.js +1 -0
- package/public/assets/index-CNcpLvjh.js +1 -0
- package/public/assets/{index-Cz_fl8aY.js → index-DPZxQS72.js} +1 -1
- package/public/assets/index-DazH9JZS.js +1 -0
- package/public/assets/index-Dsw4vOfl.css +1 -0
- package/public/assets/index-Z75kPRX1.js +1 -0
- package/public/assets/{loading-HUhLEgb_.js → loading-aqR3QZbb.js} +1 -1
- package/public/assets/main-DhuDexWn.js +57 -0
- package/public/assets/markdown-CpWe8Ysv.js +315 -0
- package/public/assets/{monaco-viewer-BgP6xpZ6.js → monaco-viewer-DephYCRo.js} +8 -8
- package/public/assets/tool-call-DE6Sz4v2.js +59 -0
- package/public/assets/{unified-picker-DuNuUpLy.js → unified-picker-Drs_u9Rq.js} +1 -1
- package/public/assets/{wrap-text-WMNsNLhk.js → wrap-text-DATH1miG.js} +1 -1
- package/public/index.html +4 -4
- package/public/loading.html +4 -4
- package/public/sw.js +1 -1
- package/public/assets/GitChangesTab-Dpwlr0_w.js +0 -2
- package/public/assets/StatusTab-CJpjUYpE.js +0 -1
- package/public/assets/index-7DpT014-.js +0 -1
- package/public/assets/index-BDK4V9L0.js +0 -1
- package/public/assets/index-Bx-Bezt2.js +0 -1
- package/public/assets/index-CEcZq5WB.js +0 -1
- package/public/assets/index-CQCmSDHL.js +0 -1
- package/public/assets/index-Dcgftm1m.css +0 -1
- package/public/assets/index-m4C3yx3J.js +0 -1
- package/public/assets/index-mh_z9p40.js +0 -2
- package/public/assets/main-AUr7QzwM.js +0 -48
- package/public/assets/markdown-Dn-JvN2g.js +0 -58
- package/public/assets/todo-DAZ1b5gb.js +0 -1
- package/public/assets/tool-call-DFuDanuj.js +0 -60
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { afterEach, describe, it } from "node:test";
|
|
6
|
+
import { FileSystemBrowser } from "../browser";
|
|
7
|
+
import { WINDOWS_DRIVES_ROOT } from "../../api-types";
|
|
8
|
+
const tempRoots = [];
|
|
9
|
+
describe("FileSystemBrowser", () => {
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
for (const directory of tempRoots.splice(0)) {
|
|
12
|
+
fs.rmSync(directory, { recursive: true, force: true });
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
it("starts unrestricted browsing from the configured root", () => {
|
|
16
|
+
const rootDir = createTempRoot();
|
|
17
|
+
fs.mkdirSync(path.join(rootDir, "project"));
|
|
18
|
+
const browser = new FileSystemBrowser({ rootDir, unrestricted: true });
|
|
19
|
+
const listing = browser.browse();
|
|
20
|
+
assert.equal(listing.metadata.scope, "unrestricted");
|
|
21
|
+
assert.equal(listing.metadata.currentPath, rootDir);
|
|
22
|
+
assert.equal(listing.metadata.rootPath, rootDir);
|
|
23
|
+
assert.equal(listing.metadata.displayPath, rootDir);
|
|
24
|
+
assert.equal(listing.metadata.pathKind, "absolute");
|
|
25
|
+
assert.ok(listing.entries.some((entry) => entry.name === "project" && entry.absolutePath === path.join(rootDir, "project")));
|
|
26
|
+
});
|
|
27
|
+
it("treats dot as the configured unrestricted root", () => {
|
|
28
|
+
const rootDir = createTempRoot();
|
|
29
|
+
const browser = new FileSystemBrowser({ rootDir, unrestricted: true });
|
|
30
|
+
const listing = browser.browse(".");
|
|
31
|
+
assert.equal(listing.metadata.currentPath, rootDir);
|
|
32
|
+
assert.equal(listing.metadata.rootPath, rootDir);
|
|
33
|
+
});
|
|
34
|
+
it("allows unrestricted browsing outside the configured root", () => {
|
|
35
|
+
const rootDir = createTempRoot();
|
|
36
|
+
const parentDir = path.dirname(rootDir);
|
|
37
|
+
const browser = new FileSystemBrowser({ rootDir, unrestricted: true });
|
|
38
|
+
const listing = browser.browse(parentDir);
|
|
39
|
+
assert.equal(listing.metadata.currentPath, parentDir);
|
|
40
|
+
assert.equal(listing.metadata.rootPath, rootDir);
|
|
41
|
+
assert.ok(listing.entries.some((entry) => entry.absolutePath === rootDir));
|
|
42
|
+
});
|
|
43
|
+
it("creates folders under the configured unrestricted root by default", () => {
|
|
44
|
+
const rootDir = createTempRoot();
|
|
45
|
+
const browser = new FileSystemBrowser({ rootDir, unrestricted: true });
|
|
46
|
+
const created = browser.createFolder(undefined, "created-folder");
|
|
47
|
+
assert.equal(created.path, path.join(rootDir, "created-folder"));
|
|
48
|
+
assert.equal(created.absolutePath, path.join(rootDir, "created-folder"));
|
|
49
|
+
assert.equal(fs.statSync(created.absolutePath).isDirectory(), true);
|
|
50
|
+
});
|
|
51
|
+
it("reports the configured root for the Windows drives pseudo-root", () => {
|
|
52
|
+
const rootDir = createTempRoot();
|
|
53
|
+
const browser = new FileSystemBrowser({ rootDir, unrestricted: true, platform: "win32" });
|
|
54
|
+
const listing = browser.browse(WINDOWS_DRIVES_ROOT);
|
|
55
|
+
assert.equal(listing.metadata.scope, "unrestricted");
|
|
56
|
+
assert.equal(listing.metadata.currentPath, WINDOWS_DRIVES_ROOT);
|
|
57
|
+
assert.equal(listing.metadata.rootPath, rootDir);
|
|
58
|
+
assert.equal(listing.metadata.pathKind, "drives");
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
function createTempRoot() {
|
|
62
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), "codenomad-browser-"));
|
|
63
|
+
tempRoots.push(root);
|
|
64
|
+
return fs.realpathSync(root);
|
|
65
|
+
}
|
|
@@ -19,11 +19,11 @@ describe("workspace search cache", () => {
|
|
|
19
19
|
it("replaces cached entries when manually refreshed", () => {
|
|
20
20
|
const workspacePath = "/tmp/workspace";
|
|
21
21
|
refreshWorkspaceCandidates(workspacePath, () => [createEntry("file-a")], 5000);
|
|
22
|
-
const initial = getWorkspaceCandidates(workspacePath);
|
|
22
|
+
const initial = getWorkspaceCandidates(workspacePath, 5001);
|
|
23
23
|
assert.ok(initial);
|
|
24
24
|
assert.equal(initial[0].name, "file-a");
|
|
25
25
|
refreshWorkspaceCandidates(workspacePath, () => [createEntry("file-b")], 6000);
|
|
26
|
-
const refreshed = getWorkspaceCandidates(workspacePath);
|
|
26
|
+
const refreshed = getWorkspaceCandidates(workspacePath, 6001);
|
|
27
27
|
assert.ok(refreshed);
|
|
28
28
|
assert.equal(refreshed[0].name, "file-b");
|
|
29
29
|
});
|
|
@@ -8,7 +8,7 @@ export class FileSystemBrowser {
|
|
|
8
8
|
this.root = path.resolve(options.rootDir);
|
|
9
9
|
this.unrestricted = Boolean(options.unrestricted);
|
|
10
10
|
this.homeDir = os.homedir();
|
|
11
|
-
this.isWindows = process.platform === "win32";
|
|
11
|
+
this.isWindows = (options.platform ?? process.platform) === "win32";
|
|
12
12
|
}
|
|
13
13
|
list(relativePath = ".", options = {}) {
|
|
14
14
|
if (this.unrestricted) {
|
|
@@ -98,7 +98,7 @@ export class FileSystemBrowser {
|
|
|
98
98
|
scope: "unrestricted",
|
|
99
99
|
currentPath: resolvedPath,
|
|
100
100
|
parentPath,
|
|
101
|
-
rootPath: this.
|
|
101
|
+
rootPath: this.root,
|
|
102
102
|
homePath: this.homeDir,
|
|
103
103
|
displayPath: resolvedPath,
|
|
104
104
|
pathKind: "absolute",
|
|
@@ -137,7 +137,7 @@ export class FileSystemBrowser {
|
|
|
137
137
|
scope: "unrestricted",
|
|
138
138
|
currentPath: WINDOWS_DRIVES_ROOT,
|
|
139
139
|
parentPath: undefined,
|
|
140
|
-
rootPath: this.
|
|
140
|
+
rootPath: this.root,
|
|
141
141
|
homePath: this.homeDir,
|
|
142
142
|
displayPath: "Drives",
|
|
143
143
|
pathKind: "drives",
|
|
@@ -253,7 +253,7 @@ export class FileSystemBrowser {
|
|
|
253
253
|
}
|
|
254
254
|
resolveUnrestrictedPath(input) {
|
|
255
255
|
if (!input || input === "." || input === "./") {
|
|
256
|
-
return this.
|
|
256
|
+
return this.root;
|
|
257
257
|
}
|
|
258
258
|
if (this.isWindows) {
|
|
259
259
|
if (input === WINDOWS_DRIVES_ROOT) {
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { getWorktreeGitDiff, getWorktreeGitStatus } from "../../workspaces/git-status";
|
|
3
3
|
import { commitWorktreeChanges, isGitMutationError, stageWorktreePaths, unstageWorktreePaths } from "../../workspaces/git-mutations";
|
|
4
|
+
import { cloneGitRepository, isGitCloneError } from "../../workspaces/git-clone";
|
|
4
5
|
import { isGitAvailable, resolveRepoRoot } from "../../workspaces/git-worktrees";
|
|
5
6
|
import { resolveWorktreeDirectory } from "../../workspaces/worktree-directory";
|
|
6
7
|
const WorkspaceCreateSchema = z.object({
|
|
7
8
|
path: z.string(),
|
|
8
9
|
name: z.string().optional(),
|
|
9
10
|
});
|
|
11
|
+
const WorkspaceCloneSchema = z.object({
|
|
12
|
+
repositoryUrl: z.string().trim().min(1, "Repository URL is required"),
|
|
13
|
+
destinationPath: z.string().trim().min(1, "Destination path is required"),
|
|
14
|
+
cleanup: z.boolean().optional(),
|
|
15
|
+
});
|
|
10
16
|
const WorkspaceFilesQuerySchema = z.object({
|
|
11
17
|
path: z.string().optional(),
|
|
12
18
|
});
|
|
@@ -53,6 +59,17 @@ export function registerWorkspaceRoutes(app, deps) {
|
|
|
53
59
|
reply.code(400).type("text/plain").send(message);
|
|
54
60
|
}
|
|
55
61
|
});
|
|
62
|
+
app.post("/api/workspaces/clone", async (request, reply) => {
|
|
63
|
+
try {
|
|
64
|
+
const body = WorkspaceCloneSchema.parse(request.body ?? {});
|
|
65
|
+
const result = await cloneGitRepository(body);
|
|
66
|
+
reply.code(201);
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
return handleWorkspaceError(error, reply);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
56
73
|
app.get("/api/workspaces/:id", async (request, reply) => {
|
|
57
74
|
const workspace = deps.workspaceManager.get(request.params.id);
|
|
58
75
|
if (!workspace) {
|
|
@@ -208,6 +225,10 @@ async function resolveGitWorktreeDirectory(workspaceManager, workspaceId, worktr
|
|
|
208
225
|
return directory;
|
|
209
226
|
}
|
|
210
227
|
function handleWorkspaceError(error, reply) {
|
|
228
|
+
if (isGitCloneError(error)) {
|
|
229
|
+
reply.code(error.statusCode);
|
|
230
|
+
return { error: error.message };
|
|
231
|
+
}
|
|
211
232
|
if (isGitMutationError(error)) {
|
|
212
233
|
reply.code(error.statusCode);
|
|
213
234
|
return { error: error.message };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { execFileSync } from "node:child_process";
|
|
3
|
+
import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { homedir, tmpdir } from "node:os";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { describe, it } from "node:test";
|
|
7
|
+
import { cloneGitRepository } from "../git-clone";
|
|
8
|
+
function createBareRepository(repoPath) {
|
|
9
|
+
execFileSync("git", ["init", "--bare", repoPath], { stdio: "ignore" });
|
|
10
|
+
}
|
|
11
|
+
async function expectCloneError(callback, expectedStatusCode, messagePattern) {
|
|
12
|
+
await assert.rejects(callback, (error) => {
|
|
13
|
+
assert.equal(typeof error, "object");
|
|
14
|
+
assert.equal(error.statusCode, expectedStatusCode);
|
|
15
|
+
assert.match(String(error.message ?? ""), messagePattern);
|
|
16
|
+
return true;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
describe("cloneGitRepository", () => {
|
|
20
|
+
it("clones into a missing destination", async () => {
|
|
21
|
+
const temp = mkdtempSync(path.join(tmpdir(), "codenomad-git-clone-"));
|
|
22
|
+
const sourceRepo = path.join(temp, "source.git");
|
|
23
|
+
const destinationPath = path.join(temp, "cloned-repo");
|
|
24
|
+
try {
|
|
25
|
+
createBareRepository(sourceRepo);
|
|
26
|
+
const result = await cloneGitRepository({
|
|
27
|
+
repositoryUrl: sourceRepo,
|
|
28
|
+
destinationPath,
|
|
29
|
+
});
|
|
30
|
+
assert.equal(result.path, destinationPath);
|
|
31
|
+
assert.equal(existsSync(path.join(destinationPath, ".git")), true);
|
|
32
|
+
}
|
|
33
|
+
finally {
|
|
34
|
+
rmSync(temp, { recursive: true, force: true });
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
it("rejects non-empty destinations when cleanup is not enabled", async () => {
|
|
38
|
+
const temp = mkdtempSync(path.join(tmpdir(), "codenomad-git-clone-"));
|
|
39
|
+
const sourceRepo = path.join(temp, "source.git");
|
|
40
|
+
const destinationPath = path.join(temp, "existing-destination");
|
|
41
|
+
const sentinelPath = path.join(destinationPath, "keep.txt");
|
|
42
|
+
try {
|
|
43
|
+
createBareRepository(sourceRepo);
|
|
44
|
+
mkdirSync(destinationPath, { recursive: true });
|
|
45
|
+
writeFileSync(sentinelPath, "keep");
|
|
46
|
+
await expectCloneError(() => cloneGitRepository({ repositoryUrl: sourceRepo, destinationPath }), 409, /Destination folder is not empty/);
|
|
47
|
+
assert.equal(readFileSync(sentinelPath, "utf8"), "keep");
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
rmSync(temp, { recursive: true, force: true });
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
it("preserves the existing destination when cleanup is enabled but clone fails", async () => {
|
|
54
|
+
const temp = mkdtempSync(path.join(tmpdir(), "codenomad-git-clone-"));
|
|
55
|
+
const missingRepo = path.join(temp, "missing.git");
|
|
56
|
+
const destinationPath = path.join(temp, "existing-destination");
|
|
57
|
+
const sentinelPath = path.join(destinationPath, "keep.txt");
|
|
58
|
+
try {
|
|
59
|
+
mkdirSync(destinationPath, { recursive: true });
|
|
60
|
+
writeFileSync(sentinelPath, "keep");
|
|
61
|
+
await expectCloneError(() => cloneGitRepository({ repositoryUrl: missingRepo, destinationPath, cleanup: true }), 409, /does not appear to be a git repository|does not exist|not found/i);
|
|
62
|
+
assert.equal(readFileSync(sentinelPath, "utf8"), "keep");
|
|
63
|
+
assert.equal(existsSync(destinationPath), true);
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
rmSync(temp, { recursive: true, force: true });
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
it("replaces the existing destination only after a successful cleanup clone", async () => {
|
|
70
|
+
const temp = mkdtempSync(path.join(tmpdir(), "codenomad-git-clone-"));
|
|
71
|
+
const sourceRepo = path.join(temp, "source.git");
|
|
72
|
+
const destinationPath = path.join(temp, "existing-destination");
|
|
73
|
+
const sentinelPath = path.join(destinationPath, "keep.txt");
|
|
74
|
+
try {
|
|
75
|
+
createBareRepository(sourceRepo);
|
|
76
|
+
mkdirSync(destinationPath, { recursive: true });
|
|
77
|
+
writeFileSync(sentinelPath, "keep");
|
|
78
|
+
const result = await cloneGitRepository({
|
|
79
|
+
repositoryUrl: sourceRepo,
|
|
80
|
+
destinationPath,
|
|
81
|
+
cleanup: true,
|
|
82
|
+
});
|
|
83
|
+
assert.equal(result.path, destinationPath);
|
|
84
|
+
assert.equal(existsSync(path.join(destinationPath, ".git")), true);
|
|
85
|
+
assert.equal(existsSync(sentinelPath), false);
|
|
86
|
+
}
|
|
87
|
+
finally {
|
|
88
|
+
rmSync(temp, { recursive: true, force: true });
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
it("rejects filesystem root destinations", async () => {
|
|
92
|
+
const temp = mkdtempSync(path.join(tmpdir(), "codenomad-git-clone-"));
|
|
93
|
+
const sourceRepo = path.join(temp, "source.git");
|
|
94
|
+
try {
|
|
95
|
+
createBareRepository(sourceRepo);
|
|
96
|
+
await expectCloneError(() => cloneGitRepository({
|
|
97
|
+
repositoryUrl: sourceRepo,
|
|
98
|
+
destinationPath: path.parse(process.cwd()).root,
|
|
99
|
+
cleanup: true,
|
|
100
|
+
}), 400, /filesystem root/);
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
rmSync(temp, { recursive: true, force: true });
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
it("rejects home directory destinations", async () => {
|
|
107
|
+
const temp = mkdtempSync(path.join(tmpdir(), "codenomad-git-clone-"));
|
|
108
|
+
const sourceRepo = path.join(temp, "source.git");
|
|
109
|
+
try {
|
|
110
|
+
createBareRepository(sourceRepo);
|
|
111
|
+
await expectCloneError(() => cloneGitRepository({
|
|
112
|
+
repositoryUrl: sourceRepo,
|
|
113
|
+
destinationPath: homedir(),
|
|
114
|
+
cleanup: true,
|
|
115
|
+
}), 400, /home folder/);
|
|
116
|
+
}
|
|
117
|
+
finally {
|
|
118
|
+
rmSync(temp, { recursive: true, force: true });
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
it("supports destinations directly under a Windows drive root", { skip: process.platform !== "win32" }, async () => {
|
|
122
|
+
const temp = mkdtempSync(path.join(tmpdir(), "codenomad-git-clone-"));
|
|
123
|
+
const sourceRepo = path.join(temp, "source.git");
|
|
124
|
+
const root = path.parse(process.cwd()).root;
|
|
125
|
+
const destinationPath = path.join(root, `codenomad-git-clone-root-${Date.now()}-${Math.random().toString(36).slice(2)}`);
|
|
126
|
+
try {
|
|
127
|
+
createBareRepository(sourceRepo);
|
|
128
|
+
rmSync(destinationPath, { recursive: true, force: true });
|
|
129
|
+
const result = await cloneGitRepository({
|
|
130
|
+
repositoryUrl: sourceRepo,
|
|
131
|
+
destinationPath,
|
|
132
|
+
});
|
|
133
|
+
assert.equal(result.path, destinationPath);
|
|
134
|
+
assert.equal(existsSync(destinationPath), true);
|
|
135
|
+
}
|
|
136
|
+
finally {
|
|
137
|
+
rmSync(destinationPath, { recursive: true, force: true });
|
|
138
|
+
rmSync(temp, { recursive: true, force: true });
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
});
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { spawn } from "child_process";
|
|
4
|
+
import { homedir } from "os";
|
|
5
|
+
class GitCloneError extends Error {
|
|
6
|
+
constructor(message, statusCode = 400) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.name = "GitCloneError";
|
|
9
|
+
this.statusCode = statusCode;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function formatErrorMessage(error, fallback) {
|
|
13
|
+
if (error instanceof Error && error.message.trim().length > 0) {
|
|
14
|
+
return error.message;
|
|
15
|
+
}
|
|
16
|
+
return fallback;
|
|
17
|
+
}
|
|
18
|
+
function normalizePathForComparison(filePath) {
|
|
19
|
+
const resolvedPath = path.resolve(filePath);
|
|
20
|
+
const rootPath = path.parse(resolvedPath).root;
|
|
21
|
+
const trimmedPath = resolvedPath === rootPath ? rootPath : resolvedPath.replace(/[\\/]+$/, "");
|
|
22
|
+
return process.platform === "win32" ? trimmedPath.toLowerCase() : trimmedPath;
|
|
23
|
+
}
|
|
24
|
+
function assertDestinationPathIsSafe(destinationPath) {
|
|
25
|
+
const normalizedDestinationPath = normalizePathForComparison(destinationPath);
|
|
26
|
+
const normalizedRootPath = normalizePathForComparison(path.parse(destinationPath).root);
|
|
27
|
+
if (normalizedDestinationPath === normalizedRootPath) {
|
|
28
|
+
throw new GitCloneError("Destination path cannot be a filesystem root", 400);
|
|
29
|
+
}
|
|
30
|
+
const normalizedHomePath = normalizePathForComparison(homedir());
|
|
31
|
+
if (normalizedDestinationPath === normalizedHomePath) {
|
|
32
|
+
throw new GitCloneError("Destination path cannot be the home folder", 400);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function createSiblingUniquePath(destinationPath, label) {
|
|
36
|
+
const parentPath = path.dirname(destinationPath);
|
|
37
|
+
const baseName = path.basename(destinationPath);
|
|
38
|
+
return path.join(parentPath, `${baseName}.${label}-${Date.now()}-${Math.random().toString(36).slice(2)}`);
|
|
39
|
+
}
|
|
40
|
+
function runGitClone(repositoryUrl, destinationPath) {
|
|
41
|
+
return new Promise((resolve, reject) => {
|
|
42
|
+
const parentPath = path.dirname(destinationPath);
|
|
43
|
+
const child = spawn("git", ["clone", "--", repositoryUrl, destinationPath], {
|
|
44
|
+
cwd: parentPath,
|
|
45
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
46
|
+
});
|
|
47
|
+
let stderr = "";
|
|
48
|
+
child.stderr?.on("data", (chunk) => {
|
|
49
|
+
stderr += chunk.toString();
|
|
50
|
+
});
|
|
51
|
+
child.once("error", (error) => {
|
|
52
|
+
reject(new GitCloneError(error.message || "Failed to start git clone", 500));
|
|
53
|
+
});
|
|
54
|
+
child.once("close", (code) => {
|
|
55
|
+
if (code === 0) {
|
|
56
|
+
resolve();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
reject(new GitCloneError(stderr.trim() || `git clone failed with code ${code}`, 409));
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function assertDestinationIsUsable(destinationPath, cleanup) {
|
|
64
|
+
if (!fs.existsSync(destinationPath))
|
|
65
|
+
return;
|
|
66
|
+
const stat = fs.statSync(destinationPath);
|
|
67
|
+
if (!stat.isDirectory()) {
|
|
68
|
+
throw new GitCloneError("Destination path exists and is not a folder", 409);
|
|
69
|
+
}
|
|
70
|
+
if (cleanup) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const entries = fs.readdirSync(destinationPath);
|
|
74
|
+
if (entries.length > 0) {
|
|
75
|
+
throw new GitCloneError("Destination folder is not empty", 409);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function ensureDestinationParentExists(destinationPath) {
|
|
79
|
+
const parentPath = path.dirname(destinationPath);
|
|
80
|
+
if (fs.existsSync(parentPath))
|
|
81
|
+
return;
|
|
82
|
+
fs.mkdirSync(parentPath, { recursive: true });
|
|
83
|
+
}
|
|
84
|
+
async function replaceDestinationAfterSuccessfulClone(repositoryUrl, destinationPath) {
|
|
85
|
+
const tempClonePath = createSiblingUniquePath(destinationPath, "clone");
|
|
86
|
+
let backupPath = null;
|
|
87
|
+
let preserveBackup = false;
|
|
88
|
+
try {
|
|
89
|
+
await runGitClone(repositoryUrl, tempClonePath);
|
|
90
|
+
backupPath = createSiblingUniquePath(destinationPath, "backup");
|
|
91
|
+
fs.renameSync(destinationPath, backupPath);
|
|
92
|
+
try {
|
|
93
|
+
fs.renameSync(tempClonePath, destinationPath);
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
try {
|
|
97
|
+
fs.renameSync(backupPath, destinationPath);
|
|
98
|
+
backupPath = null;
|
|
99
|
+
}
|
|
100
|
+
catch (restoreError) {
|
|
101
|
+
preserveBackup = true;
|
|
102
|
+
throw new GitCloneError(`Failed to replace clone destination and restore previous contents: ${formatErrorMessage(restoreError, "restore failed")}`, 500);
|
|
103
|
+
}
|
|
104
|
+
throw new GitCloneError(`Failed to replace clone destination: ${formatErrorMessage(error, "rename failed")}`, 500);
|
|
105
|
+
}
|
|
106
|
+
fs.rmSync(backupPath, { recursive: true, force: true });
|
|
107
|
+
backupPath = null;
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
if (error instanceof GitCloneError) {
|
|
111
|
+
throw error;
|
|
112
|
+
}
|
|
113
|
+
throw new GitCloneError(`Failed to prepare clone destination: ${formatErrorMessage(error, "unknown error")}`, 500);
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
if (backupPath && !preserveBackup && fs.existsSync(backupPath)) {
|
|
117
|
+
fs.rmSync(backupPath, { recursive: true, force: true });
|
|
118
|
+
}
|
|
119
|
+
if (fs.existsSync(tempClonePath)) {
|
|
120
|
+
fs.rmSync(tempClonePath, { recursive: true, force: true });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
export function isGitCloneError(error) {
|
|
125
|
+
return error instanceof GitCloneError;
|
|
126
|
+
}
|
|
127
|
+
export async function cloneGitRepository(params) {
|
|
128
|
+
const repositoryUrl = params.repositoryUrl.trim();
|
|
129
|
+
const requestedDestinationPath = params.destinationPath.trim();
|
|
130
|
+
if (!repositoryUrl) {
|
|
131
|
+
throw new GitCloneError("Repository URL is required", 400);
|
|
132
|
+
}
|
|
133
|
+
if (!path.isAbsolute(requestedDestinationPath)) {
|
|
134
|
+
throw new GitCloneError("Destination path must be absolute", 400);
|
|
135
|
+
}
|
|
136
|
+
const destinationPath = path.resolve(requestedDestinationPath);
|
|
137
|
+
assertDestinationPathIsSafe(destinationPath);
|
|
138
|
+
ensureDestinationParentExists(destinationPath);
|
|
139
|
+
const destinationExists = fs.existsSync(destinationPath);
|
|
140
|
+
assertDestinationIsUsable(destinationPath, Boolean(params.cleanup));
|
|
141
|
+
if (destinationExists && params.cleanup) {
|
|
142
|
+
await replaceDestinationAfterSuccessfulClone(repositoryUrl, destinationPath);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
await runGitClone(repositoryUrl, destinationPath);
|
|
146
|
+
}
|
|
147
|
+
return { path: destinationPath };
|
|
148
|
+
}
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-
|
|
2
|
-
import{_ as K}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-DephYCRo.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as K}from"./index-Bv35Fv-v.js";import{m as B,t as g,i as a,d as w,a as z,f as N}from"./monaco-viewer-DephYCRo.js";import{c as f,n as c,a as L,F,S as W,z as j,A as q}from"./git-diff-vendor-CSgooKT_.js";import{D as G}from"./DiffToolbar-CNfiD6cp.js";import{S as H}from"./SplitFilePanel-DMnUqWnk.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./main-DhuDexWn.js";import"./align-justify-pBFgPIct.js";import"./wrap-text-DATH1miG.js";var J=g('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),T=g("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Q=g('<div class="p-3 text-xs text-secondary">'),E=g("<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-"),U=g("<span class=files-tab-selected-path><span class=file-path-text>"),X=g('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Y=g("<div style=margin-left:auto>");const Z=q(()=>K(()=>import("./monaco-viewer-DephYCRo.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),ce=e=>{const M=f(()=>e.activeSessionId()),S=f(()=>!!(M()&&M()!=="info")),D=f(()=>S()?e.activeSessionDiffs():null),m=f(()=>{const n=D();return Array.isArray(n)?[...n].sort((i,l)=>String(i.file||"").localeCompare(String(l.file||""))):[]}),R=f(()=>m().reduce((n,i)=>(n.additions+=typeof i.additions=="number"?i.additions:0,n.deletions+=typeof i.deletions=="number"?i.deletions:0,n),{additions:0,deletions:0})),I=f(()=>{const n=m();return n.length===0?null:n.reduce((i,l)=>{const v=typeof(i==null?void 0:i.additions)=="number"?i.additions:0,y=typeof(i==null?void 0:i.deletions)=="number"?i.deletions:0,x=v+y,k=typeof(l==null?void 0:l.additions)=="number"?l.additions:0,t=typeof(l==null?void 0:l.deletions)=="number"?l.deletions:0,r=k+t;return r>x?l:r<x?i:String(l.file||"").localeCompare(String((i==null?void 0:i.file)||""))<0?l:i},n[0])}),P=f(()=>{const n=e.selectedFile(),i=m();if(n){const l=i.find(v=>v.file===n);if(l)return l}return I()}),O=f(()=>`${e.instanceId}:${S()?M():"no-session"}`),V=f(()=>{if(!S())return e.t("instanceShell.sessionChanges.noSessionSelected");const n=D();return n===void 0?e.t("instanceShell.sessionChanges.loading"):!Array.isArray(n)||n.length===0?e.t("instanceShell.sessionChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty")}),A=f(()=>{const n=P();return n!=null&&n.file?String(n.file):e.t("instanceShell.rightPanel.tabs.changes")});return B(()=>{const n=m(),i=R(),l=P(),v=()=>(()=>{var t=J(),r=t.firstChild;return a(r,c(W,{get when(){return l&&S()&&n.length>0?l:null},get fallback(){return(()=>{var d=T(),s=d.firstChild;return a(s,V),d})()},children:d=>c(j,{get fallback(){return(()=>{var s=T(),u=s.firstChild;return a(u,()=>e.t("instanceInfo.loading")),s})()},get children(){return c(Z,{get scopeKey(){return O()},get path(){return String(d().file||"")},get patch(){return String(d().patch||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})),t})(),y=()=>(()=>{var t=Q();return a(t,V),t})();return c(H,{get header(){return[(()=>{var t=U(),r=t.firstChild;return a(r,A),L(()=>w(t,"title",A())),t})(),(()=>{var t=X(),r=t.firstChild,d=r.firstChild;d.firstChild;var s=r.nextSibling,u=s.firstChild;return u.firstChild,a(d,()=>i.additions,null),a(u,()=>i.deletions,null),t})(),(()=>{var t=Y();return a(t,c(G,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})),t})()]},list:{panel:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(F,{each:n,children:t=>(()=>{var r=E(),d=r.firstChild,s=d.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,e.isPhoneLayout())},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(o=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file;return _!==o.e&&z(r,o.e=_),$!==o.t&&w(s,"title",o.t=$),o},{e:void 0,t:void 0}),r})()})}}),overlay:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(F,{each:n,children:t=>(()=>{var r=E(),d=r.firstChild,s=d.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,!0)},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(o=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file,p=t.file;return _!==o.e&&z(r,o.e=_),$!==o.t&&w(r,"title",o.t=$),p!==o.a&&w(s,"title",o.a=p),o},{e:void 0,t:void 0,a:void 0}),r})()})}})},get viewer(){return v()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.changes")}})})};N(["click"]);export{ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-
|
|
1
|
+
import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-DephYCRo.js";import{u as T}from"./index-Bv35Fv-v.js";import{n as o,m as $,a as V}from"./git-diff-vendor-CSgooKT_.js";import{I as U,S as A,N as I}from"./main-DhuDexWn.js";import{A as N}from"./align-justify-pBFgPIct.js";import{W as D}from"./wrap-text-DATH1miG.js";const E=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],F=t=>o(U,$(t,{name:"UnfoldVertical",iconNode:E}));var H=g("<div class=file-viewer-toolbar><button type=button class=file-viewer-toolbar-icon-button></button><button type=button class=file-viewer-toolbar-icon-button></button><button type=button>");const B=t=>{const{t:a}=T(),d=()=>t.viewMode==="split"?"unified":"split",s=()=>t.contextMode==="collapsed"?"expanded":"collapsed",f=()=>t.wordWrapMode==="on"?"off":"on",h=()=>d()==="split"?a("instanceShell.diff.switchToSplit"):a("instanceShell.diff.switchToUnified"),v=()=>s()==="collapsed"?a("instanceShell.diff.hideUnchanged"):a("instanceShell.diff.showFull"),u=()=>f()==="on"?a("instanceShell.diff.enableWordWrap"):a("instanceShell.diff.disableWordWrap");return(()=>{var b=H(),n=b.firstChild,l=n.nextSibling,r=l.nextSibling;return n.$$click=()=>t.onViewModeChange(d()),c(n,(()=>{var e=W(()=>d()==="split");return()=>e()?o(A,{class:"h-4 w-4","aria-hidden":"true"}):o(N,{class:"h-4 w-4","aria-hidden":"true"})})()),l.$$click=()=>t.onContextModeChange(s()),c(l,(()=>{var e=W(()=>s()==="collapsed");return()=>e()?o(I,{class:"h-4 w-4","aria-hidden":"true"}):o(F,{class:"h-4 w-4","aria-hidden":"true"})})()),r.$$click=()=>t.onWordWrapModeChange(f()),c(r,o(D,{class:"h-4 w-4","aria-hidden":"true"})),V(e=>{var m=h(),w=h(),M=v(),p=v(),x=`file-viewer-toolbar-icon-button${t.wordWrapMode==="on"?" active":""}`,k=u(),y=u();return m!==e.e&&i(n,"aria-label",e.e=m),w!==e.t&&i(n,"title",e.t=w),M!==e.a&&i(l,"aria-label",e.a=M),p!==e.o&&i(l,"title",e.o=p),x!==e.i&&S(r,e.i=x),k!==e.n&&i(r,"aria-label",e.n=k),y!==e.s&&i(r,"title",e.s=y),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),b})()};C(["click"]);export{B as D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-
|
|
2
|
-
import{_ as G}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-DephYCRo.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as G}from"./index-Bv35Fv-v.js";import{Z as J,m,t as h,i as s,d as u,a as C,u as U,f as X}from"./monaco-viewer-DephYCRo.js";import{n as o,m as Y,d as A,b as P,c as $,S as g,a as w,z as p,A as ee,F as te}from"./git-diff-vendor-CSgooKT_.js";import{S as le}from"./SplitFilePanel-DMnUqWnk.js";import{I as ne,R as K,M as re,O as ae,C as ie,e as se,P as oe}from"./main-DhuDexWn.js";import{W as ce}from"./wrap-text-DATH1miG.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const de=[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]],he=e=>o(ne,Y(e,{name:"Save",iconNode:de}));var ue=h('<div class="px-2 py-2 border-b border-base"><div class=selector-input-group><div class="flex items-center gap-2 px-3 text-muted"></div><input type=text class=selector-input>'),ve=h("<div class=file-list-header><span class=file-list-title></span><span class=file-list-count>"),O=h('<div class="p-3 text-xs text-secondary">'),fe=h("<div class=file-list-item><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text>.."),ge=h('<div class="p-3 text-xs text-error">'),we=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class="flex items-center gap-2 shrink-0"><div class=file-list-item-stats><span class="text-[10px] text-secondary"></span></div><button type=button class=git-change-row-action>'),k=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Se=h('<div class="file-viewer-panel flex-1"><div>'),be=h('<div class="h-full outline-none"tabindex=0>'),me=h("<span>"),$e=h("<div class=files-tab-stats><span class=files-tab-stat><span class=files-tab-selected-path><span class=file-path-text>"),ye=h("<button type=button style=margin-inline-start:auto>"),_e=h("<button type=button>"),q=h("<button type=button class=files-header-icon-button>"),Ce=h("<span class=text-error>");const ke=ee(()=>G(()=>import("./monaco-viewer-DephYCRo.js").then(e=>e.ae),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoFileViewer})));function xe(e){return e?/\.(md|markdown|mdown|mkdn)$/i.test(e):!1}const Ie=e=>{const[E,L]=A(""),{isDark:N}=J(),[Q,M]=A(!1);let S;P(()=>{e.browserPath(),L("")});const H=$(()=>[...e.browserEntries()||[]].sort((i,d)=>{const l=i.type==="directory"?0:1,t=d.type==="directory"?0:1;return l!==t?l-t:String(i.name||"").localeCompare(String(d.name||""))})),W=$(()=>E().trim().toLowerCase()),x=$(()=>{const n=W(),i=H();return n?i.filter(d=>String(d.name||"").toLowerCase().includes(n)):i}),y=()=>e.browserLoading()&&e.browserEntries()===null,Z=()=>W()?e.t("instanceShell.filesShell.search.empty"):e.t("instanceShell.filesShell.listEmpty"),_=$(()=>xe(e.browserSelectedPath())),b=$(()=>_()&&Q());P(()=>{_()||M(!1)});const D=()=>{const n=e.browserSelectedContent();n!=null&&e.onSave(n)},j=async(n,i)=>{i==null||i.stopPropagation();const d=await se(n);oe({message:d?e.t("instanceShell.filesShell.toast.copyPathSuccess"):e.t("instanceShell.filesShell.toast.copyPathError"),variant:d?"success":"error"})};P(()=>{b()&&requestAnimationFrame(()=>S==null?void 0:S.focus())});const T=()=>[(()=>{var n=ue(),i=n.firstChild,d=i.firstChild,l=d.nextSibling;return s(d,o(ae,{class:"w-4 h-4"})),l.$$input=t=>L(t.currentTarget.value),w(t=>{var a=e.t("instanceShell.filesShell.search.placeholder"),r=e.t("instanceShell.filesShell.search.ariaLabel");return a!==t.e&&u(l,"placeholder",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),t},{e:void 0,t:void 0}),w(()=>l.value=E()),n})(),(()=>{var n=ve(),i=n.firstChild,d=i.nextSibling;return s(i,()=>e.t("instanceShell.filesShell.fileListTitle")),s(d,()=>x().length),n})(),o(g,{get when(){return e.parentPath()},children:n=>(()=>{var i=fe(),d=i.firstChild,l=d.firstChild;return i.$$click=()=>e.onLoadEntries(n()),w(()=>u(l,"title",n())),i})()}),o(g,{get when(){return y()},get children(){var n=O();return s(n,()=>e.t("instanceInfo.loading")),n}}),o(g,{get when(){return m(()=>!e.browserError()&&!y())()&&x().length>0},get fallback(){return m(()=>!y())()?m(()=>!!e.browserError())()?(()=>{var n=ge();return s(n,()=>e.browserError()),n})():(()=>{var n=O();return s(n,Z),n})():void 0},get children(){return o(te,{get each(){return x()},children:n=>(()=>{var i=we(),d=i.firstChild,l=d.firstChild,t=l.firstChild,a=l.nextSibling,r=a.firstChild,c=r.firstChild,f=r.nextSibling;return i.$$click=()=>{if(n.type==="directory"){e.onLoadEntries(n.path);return}e.onRequestOpenFile(n.path)},s(t,()=>n.name),s(c,()=>n.type),f.$$click=v=>void j(n.path,v),s(f,o(ie,{class:"w-3 h-3"})),w(v=>{var F=`file-list-item ${e.browserSelectedPath()===n.path?"file-list-item-active":""}`,z=n.path,I=n.path,R=e.t("instanceShell.filesShell.actions.copyPath"),V=e.t("instanceShell.filesShell.actions.copyPath");return F!==v.e&&C(i,v.e=F),z!==v.t&&u(i,"title",v.t=z),I!==v.a&&u(l,"title",v.a=I),R!==v.o&&u(f,"title",v.o=R),V!==v.i&&u(f,"aria-label",v.i=V),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i})()})}})],B=n=>{!(n.ctrlKey||n.metaKey)||n.key.toLowerCase()!=="s"||e.browserSelectedSaving()||!e.browserSelectedDirty()||(n.preventDefault(),D())};return m(()=>{const n=()=>e.browserSelectedPath()||e.browserPath(),i=()=>y()?e.t("instanceInfo.loading"):e.t("instanceShell.filesShell.viewerEmpty"),d=()=>(()=>{var l=Se(),t=l.firstChild;return s(t,o(g,{get when(){return e.browserSelectedLoading()},get fallback(){return o(g,{get when(){return e.browserSelectedError()},get fallback(){return o(g,{get when(){return m(()=>!!(e.browserSelectedPath()&&e.browserSelectedContent()!==null))()?{path:e.browserSelectedPath(),content:e.browserSelectedContent()}:null},get fallback(){return(()=>{var a=k(),r=a.firstChild;return s(r,i),a})()},children:a=>o(g,{get when(){return b()},get fallback(){return o(p,{get fallback(){return(()=>{var r=k(),c=r.firstChild;return s(c,()=>e.t("instanceInfo.loading")),r})()},get children(){return o(ke,{get scopeKey(){return e.scopeKey()},get path(){return a().path},get content(){return a().content},get wordWrap(){return e.wordWrapMode()},get onSave(){return e.onSave},get onContentChange(){return e.onContentChange}})}})},get children(){var r=be();r.$$mousedown=()=>S==null?void 0:S.focus(),r.$$keydown=B;var c=S;return typeof c=="function"?U(c,r):S=r,s(r,o(re,{get part(){return{type:"text",text:a().content}},get isDark(){return N()},escapeRawHtml:!0})),r}})})},children:a=>(()=>{var r=k(),c=r.firstChild;return s(c,a),r})()})},get children(){var a=k(),r=a.firstChild;return s(r,()=>e.t("instanceInfo.loading")),a}})),w(()=>C(t,b()?"file-viewer-content":"file-viewer-content file-viewer-content--monaco")),l})();return o(le,{get header(){return[(()=>{var l=$e(),t=l.firstChild,a=t.firstChild,r=a.firstChild;return s(r,n),s(l,o(g,{get when(){return e.browserLoading()},get children(){var c=me();return s(c,()=>e.t("instanceInfo.loading")),c}}),null),s(l,o(g,{get when(){return e.browserError()},children:c=>(()=>{var f=Ce();return s(f,c),f})()}),null),w(()=>u(a,"title",n())),l})(),(()=>{var l=ye();return l.$$click=()=>_()&&M(t=>!t),s(l,(()=>{var t=m(()=>!!b());return()=>t()?e.t("instanceShell.filesShell.showSource"):e.t("instanceShell.filesShell.previewMarkdown")})()),w(t=>{var a=`file-viewer-toolbar-button${b()?" active":""}`,r=!_();return a!==t.e&&C(l,t.e=a),r!==t.t&&(l.disabled=t.t=r),t},{e:void 0,t:void 0}),l})(),(()=>{var l=_e();return l.$$click=()=>e.onWordWrapModeChange(e.wordWrapMode()==="on"?"off":"on"),s(l,o(ce,{class:"h-4 w-4"})),w(t=>{var a=`file-viewer-toolbar-icon-button${e.wordWrapMode()==="on"?" active":""}`,r=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),c=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),f=b();return a!==t.e&&C(l,t.e=a),r!==t.t&&u(l,"title",t.t=r),c!==t.a&&u(l,"aria-label",t.a=c),f!==t.o&&(l.disabled=t.o=f),t},{e:void 0,t:void 0,a:void 0,o:void 0}),l})(),(()=>{var l=q();return l.$$click=D,s(l,o(g,{get when(){return e.browserSelectedSaving()},get fallback(){return o(he,{class:"h-4 w-4"})},get children(){return o(K,{class:"h-4 w-4 animate-spin"})}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.save")||"Save (Ctrl+S)",r=e.t("instanceShell.rightPanel.actions.save")||"Save",c=e.browserSelectedSaving()||!e.browserSelectedDirty();return a!==t.e&&u(l,"title",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})(),(()=>{var l=q();return l.$$click=()=>e.onRefresh(),s(l,o(K,{get class(){return`h-4 w-4${e.browserLoading()?" animate-spin":""}`}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.refresh"),r=e.t("instanceShell.rightPanel.actions.refresh"),c=e.browserLoading();return a!==t.e&&u(l,"title",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})()]},list:{panel:()=>o(T,{}),overlay:()=>o(T,{})},get viewer(){return d()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.files")}})})};X(["input","click","keydown","mousedown"]);export{Ie as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-DephYCRo.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as se}from"./index-Bv35Fv-v.js";import{m as V,t as h,i as n,d as b,h as H,a as J,f as le}from"./monaco-viewer-DephYCRo.js";import{c as m,n as r,a as k,S as w,F as N,z as re,A as ce}from"./git-diff-vendor-CSgooKT_.js";import{D as oe}from"./DiffToolbar-CNfiD6cp.js";import{S as de}from"./SplitFilePanel-DMnUqWnk.js";import{G as ge,R as he,H as j,J as Q,K as ue}from"./main-DhuDexWn.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./align-justify-pBFgPIct.js";import"./wrap-text-DATH1miG.js";var W=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),fe=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),me=h('<div class="p-3 text-xs text-secondary">'),ve=h('<span class="git-change-row-action-bar git-change-row-action-bar-vertical">'),Ce=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=git-change-list-item-right><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-</span></div></div></div><div class=git-change-list-item-actions-zone><div class=git-change-list-item-actions><button type=button class=git-change-row-action><span aria-hidden=true><span class="git-change-row-action-bar git-change-row-action-bar-horizontal">'),$e=h("<div class=git-change-section-items>"),be=h("<div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title></span></span><span class=git-change-section-count>"),_e=h('<div class=git-change-section-items><div class=git-change-commit-box><div class=git-change-commit-input-wrap><textarea class=git-change-commit-input rows=1></textarea><button type=button class="git-change-commit-button git-change-commit-button-overlay">'),we=h("<div class=git-change-sections><div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title-row><span class=git-change-section-title></span></span></span><span class=git-change-section-count>"),Se=h('<span class="status-indicator session-status-list worktree-indicator git-change-section-badge"><span class=worktree-indicator-label>'),ye=h("<span class=files-tab-selected-path><span class=file-path-text>"),xe=h('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Ie=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Me=h("<span class=text-error>");const Le=ce(()=>se(()=>import("./monaco-viewer-DephYCRo.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),Oe=e=>{const T=m(()=>e.activeSessionId()),P=m(()=>!!(T()&&T()!=="info")),A=m(()=>P()?e.entries():null),X=m(()=>{const o=A();return Array.isArray(o)?[...o].sort((d,x)=>String(d.path||"").localeCompare(String(x.path||""))):[]}),S=m(()=>ge(X())),Y=m(()=>S().reduce((o,d)=>(o.additions+=typeof d.additions=="number"?d.additions:0,o.deletions+=typeof d.deletions=="number"?d.deletions:0,o),{additions:0,deletions:0})),z=m(()=>S().filter(o=>o.section==="staged")),Z=m(()=>S().filter(o=>o.section==="unstaged")),p=m(()=>z().length>0&&e.commitMessage().trim().length>0&&!e.commitSubmitting()),ee=m(()=>{const o=S(),d=e.selectedItemId(),x=e.mostChangedItemId(),I=o.find(E=>E.id===d)||(x?o.find(E=>E.id===x):void 0);return(I==null?void 0:I.entry)??null}),D=m(()=>P()?A()===null?e.t("instanceShell.gitChanges.loading"):S().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected")),te=m(()=>e.selectedError()===e.t("instanceShell.gitChanges.binaryViewer"));return V(()=>{const o=Y(),d=ee(),x=S(),I=z(),E=Z(),ne=()=>(()=>{var t=fe(),l=t.firstChild;return n(l,r(w,{get when(){return e.selectedLoading()},get fallback(){return r(w,{get when(){return e.selectedError()},get fallback(){return r(w,{get when(){return V(()=>!!(d&&e.selectedBefore()!==null&&e.selectedAfter()!==null))()?{path:d.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=W(),s=i.firstChild;return n(s,D),i})()},children:i=>r(re,{get fallback(){return(()=>{var s=W(),a=s.firstChild;return n(a,()=>e.t("instanceInfo.loading")),s})()},get children(){return r(Le,{get scopeKey(){return e.scopeKey()},get path(){return String(i().path||"")},get before(){return String(i().before||"")},get after(){return String(i().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()},get insertContextLabel(){return e.t("instanceShell.gitChanges.actions.insertContext")},get onRequestInsertContext(){return te()?void 0:s=>{const a=e.selectedItemId();if(!a)return;const g=S().find(u=>u.id===a);g&&e.onInsertContext(g,s)}}})}})})},children:i=>(()=>{var s=W(),a=s.firstChild;return n(a,i),s})()})},get children(){var i=W(),s=i.firstChild;return n(s,()=>e.t("instanceInfo.loading")),i}})),t})(),ie=()=>(()=>{var t=me();return n(t,D),t})(),B=t=>{const l=m(()=>e.selectedBulkItemIds().has(t.id)),i=t.section==="staged"?e.t("instanceShell.gitChanges.actions.unstage"):e.t("instanceShell.gitChanges.actions.stage"),s=()=>{t.section==="staged"?e.onUnstageFile(t):e.onStageFile(t)};return(()=>{var a=Ce(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=u.nextSibling,$=v.firstChild,C=$.firstChild;C.firstChild;var _=C.nextSibling;_.firstChild;var R=g.nextSibling,f=R.firstChild,y=f.firstChild,L=y.firstChild;return L.firstChild,a.$$click=c=>e.onRowClick(t,c),a.$$mousedown=c=>{(c.shiftKey||c.ctrlKey||c.metaKey)&&c.preventDefault()},n(M,()=>t.path),n(C,()=>t.additions,null),n(_,()=>t.deletions,null),y.$$click=c=>{c.stopPropagation(),s()},b(y,"title",i),b(y,"aria-label",i),n(L,r(w,{get when(){return t.section!=="staged"},get children(){return ve()}}),null),k(c=>{var K=`file-list-item git-change-list-item ${e.selectedItemId()===t.id?"file-list-item-active":""} ${l()?"git-change-list-item-bulk-selected":""}`,F=t.path,G=t.path,U=t.path,q=`git-change-row-action-glyph ${t.section==="staged"?"git-change-row-action-glyph-minus":"git-change-row-action-glyph-plus"}`;return K!==c.e&&J(a,c.e=K),F!==c.t&&b(a,"title",c.t=F),G!==c.a&&b(g,"title",c.a=G),U!==c.o&&b(u,"title",c.o=U),q!==c.i&&J(L,c.i=q),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()},ae=(t,l,i,s)=>(()=>{var a=be(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=M.nextSibling,$=u.nextSibling;return H(g,"click",s,!0),n(M,i?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})),n(v,t),n($,()=>l.length),n(a,r(w,{when:i,get children(){var C=$e();return n(C,r(N,{each:l,children:_=>B(_)})),C}}),null),a})(),O=()=>r(w,{get when(){return x.length>0},get fallback(){return ie()},get children(){var t=we(),l=t.firstChild,i=l.firstChild,s=i.firstChild,a=s.firstChild,g=a.nextSibling,u=g.firstChild,M=s.nextSibling;return H(i,"click",e.onToggleStagedOpen,!0),n(a,(()=>{var v=V(()=>!!e.stagedOpen());return()=>v()?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})})()),n(u,()=>e.t("instanceShell.gitChanges.sections.staged")),n(g,r(w,{get when(){return e.branchLabel()},children:v=>(()=>{var $=Se(),C=$.firstChild;return n($,r(ue,{class:"w-3.5 h-3.5","aria-hidden":"true"}),C),n(C,v),k(()=>b($,"title",`Branch: ${v()}`)),$})()}),null),n(M,()=>I.length),n(l,r(w,{get when(){return e.stagedOpen()},get children(){var v=_e(),$=v.firstChild,C=$.firstChild,_=C.firstChild,R=_.nextSibling;return _.$$input=f=>e.onCommitMessageInput(f.currentTarget.value),R.$$click=()=>e.onSubmitCommit(),n(R,(()=>{var f=V(()=>!!e.commitSubmitting());return()=>f()?e.t("instanceShell.gitChanges.commit.submitting"):e.t("instanceShell.gitChanges.commit.submit")})()),n(v,r(N,{each:I,children:f=>B(f)}),null),k(f=>{var y=e.t("instanceShell.gitChanges.commit.placeholder"),L=!p();return y!==f.e&&b(_,"placeholder",f.e=y),L!==f.t&&(R.disabled=f.t=L),f},{e:void 0,t:void 0}),k(()=>_.value=e.commitMessage()),v}}),null),n(t,()=>ae(e.t("instanceShell.gitChanges.sections.unstaged"),E,e.unstagedOpen(),e.onToggleUnstagedOpen),null),t}});return r(de,{get header(){return[(()=>{var t=ye(),l=t.firstChild;return n(l,()=>(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),k(()=>b(t,"title",(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=xe(),l=t.firstChild,i=l.firstChild;i.firstChild;var s=l.nextSibling,a=s.firstChild;return a.firstChild,n(i,()=>o.additions,null),n(a,()=>o.deletions,null),n(t,r(w,{get when(){return e.statusError()},children:g=>(()=>{var u=Me();return n(u,g),u})()}),null),t})(),(()=>{var t=Ie();return t.$$click=()=>e.onRefresh(),n(t,r(he,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),k(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),s=e.t("instanceShell.rightPanel.actions.refresh"),a=!P()||e.statusLoading()||A()===null;return i!==l.e&&b(t,"title",l.e=i),s!==l.t&&b(t,"aria-label",l.t=s),a!==l.a&&(t.disabled=l.a=a),l},{e:void 0,t:void 0,a:void 0}),t})(),r(oe,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:O,overlay:O},get viewer(){return ne()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};le(["mousedown","click","input"]);export{Oe as default};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|