gitxelectron 1.1.0 → 1.1.2
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/out/main/index.js
CHANGED
|
@@ -443,7 +443,8 @@ function initGit(sessionId, baseDir) {
|
|
|
443
443
|
const options = {
|
|
444
444
|
baseDir,
|
|
445
445
|
binary: "git",
|
|
446
|
-
maxConcurrentProcesses: 6
|
|
446
|
+
maxConcurrentProcesses: 6,
|
|
447
|
+
unsafe: { allowUnsafeEditor: true, allowUnsafeAskPass: true, allowUnsafeCredentialHelper: true }
|
|
447
448
|
};
|
|
448
449
|
const git = simpleGit.simpleGit(options);
|
|
449
450
|
gitSessions.set(sessionId, { git, repoPath: baseDir });
|
|
@@ -466,7 +467,7 @@ async function isGitRepo(dir) {
|
|
|
466
467
|
}
|
|
467
468
|
async function initializeRepo(sessionId, dir) {
|
|
468
469
|
try {
|
|
469
|
-
const tempGit = simpleGit.simpleGit(dir);
|
|
470
|
+
const tempGit = simpleGit.simpleGit({ baseDir: dir, unsafe: { allowUnsafeEditor: true, allowUnsafeAskPass: true, allowUnsafeCredentialHelper: true } });
|
|
470
471
|
await tempGit.init();
|
|
471
472
|
const branches = await tempGit.branchLocal();
|
|
472
473
|
if (branches.all.length === 0) {
|
|
@@ -559,7 +560,7 @@ async function pushToRemote(sessionId, remote, branch) {
|
|
|
559
560
|
const { git } = getGitSession(sessionId);
|
|
560
561
|
const remotes = await getRemotes(sessionId);
|
|
561
562
|
const remoteObj = remotes.find((r) => r.name === remote);
|
|
562
|
-
const tempGit =
|
|
563
|
+
const tempGit = simpleGit.simpleGit({ baseDir: getGitSession(sessionId).repoPath, unsafe: { allowUnsafeEditor: true, allowUnsafeAskPass: true, allowUnsafeCredentialHelper: true } }).env({
|
|
563
564
|
...process.env,
|
|
564
565
|
GCM_INTERACTIVE: "false",
|
|
565
566
|
GIT_TERMINAL_PROMPT: "0",
|
|
@@ -614,7 +615,8 @@ async function getBranches(sessionId) {
|
|
|
614
615
|
const remotes = await git.getRemotes(true);
|
|
615
616
|
if (remotes.length > 0) {
|
|
616
617
|
const remoteObj = remotes[0];
|
|
617
|
-
const tempGit = simpleGit.simpleGit(getGitSession(sessionId).repoPath).env({
|
|
618
|
+
const tempGit = simpleGit.simpleGit({ baseDir: getGitSession(sessionId).repoPath, unsafe: { allowUnsafeEditor: true, allowUnsafeAskPass: true, allowUnsafeCredentialHelper: true } }).env({
|
|
619
|
+
...process.env,
|
|
618
620
|
GCM_INTERACTIVE: "false",
|
|
619
621
|
GIT_TERMINAL_PROMPT: "0",
|
|
620
622
|
GIT_ASKPASS: "echo"
|
|
@@ -699,7 +701,7 @@ async function pushAllBranches(sessionId, remote) {
|
|
|
699
701
|
const { git } = getGitSession(sessionId);
|
|
700
702
|
const remotes = await getRemotes(sessionId);
|
|
701
703
|
const remoteObj = remotes.find((r) => r.name === remote);
|
|
702
|
-
const tempGit =
|
|
704
|
+
const tempGit = simpleGit.simpleGit({ baseDir: getGitSession(sessionId).repoPath, unsafe: { allowUnsafeEditor: true, allowUnsafeAskPass: true, allowUnsafeCredentialHelper: true } }).env({
|
|
703
705
|
...process.env,
|
|
704
706
|
GCM_INTERACTIVE: "false",
|
|
705
707
|
GIT_TERMINAL_PROMPT: "0",
|
|
@@ -807,7 +809,7 @@ async function setupUniversalWorkspace(sessionId, remoteUrl, branch, baseBranch,
|
|
|
807
809
|
const tempId = crypto.randomUUID();
|
|
808
810
|
const workspacePath = path__namespace.join(electron.app.getPath("temp"), `gitelectron_universal_${tempId}`);
|
|
809
811
|
await fs__namespace.mkdir(workspacePath, { recursive: true });
|
|
810
|
-
const git = simpleGit.simpleGit(workspacePath);
|
|
812
|
+
const git = simpleGit.simpleGit({ baseDir: workspacePath, unsafe: { allowUnsafeEditor: true, allowUnsafeAskPass: true, allowUnsafeCredentialHelper: true } });
|
|
811
813
|
await git.init();
|
|
812
814
|
let authUrl = remoteUrl;
|
|
813
815
|
if (remoteUrl.includes("github.com")) {
|
|
@@ -867,7 +869,7 @@ async function checkUniversalCollisions(workspacePath, sourceFiles, destinationP
|
|
|
867
869
|
};
|
|
868
870
|
}
|
|
869
871
|
async function getUniversalDiff(workspacePath, filePath) {
|
|
870
|
-
const git = simpleGit.simpleGit(workspacePath);
|
|
872
|
+
const git = simpleGit.simpleGit({ baseDir: workspacePath, unsafe: { allowUnsafeEditor: true, allowUnsafeAskPass: true, allowUnsafeCredentialHelper: true } });
|
|
871
873
|
try {
|
|
872
874
|
const diff = await git.raw(["diff", "--", filePath]);
|
|
873
875
|
return diff;
|
|
@@ -876,7 +878,7 @@ async function getUniversalDiff(workspacePath, filePath) {
|
|
|
876
878
|
}
|
|
877
879
|
}
|
|
878
880
|
async function commitUniversalWorkspace(workspacePath, message, branch) {
|
|
879
|
-
const git = simpleGit.simpleGit(workspacePath).env({
|
|
881
|
+
const git = simpleGit.simpleGit({ baseDir: workspacePath, unsafe: { allowUnsafeEditor: true, allowUnsafeAskPass: true, allowUnsafeCredentialHelper: true } }).env({
|
|
880
882
|
...process.env,
|
|
881
883
|
GCM_INTERACTIVE: "false",
|
|
882
884
|
GIT_TERMINAL_PROMPT: "0",
|
package/out/preload/index.js
CHANGED
|
@@ -33,6 +33,7 @@ const api = {
|
|
|
33
33
|
setGitConfig: (key, value, global = false) => electron.ipcRenderer.invoke("set-git-config", key, value, global),
|
|
34
34
|
readFile: (file) => electron.ipcRenderer.invoke("read-file", file),
|
|
35
35
|
writeFile: (file, content) => electron.ipcRenderer.invoke("write-file", file, content),
|
|
36
|
+
executeRawGit: (args) => electron.ipcRenderer.invoke("execute-raw-git", args),
|
|
36
37
|
// NEW: Multi-Account & Window
|
|
37
38
|
newWindow: () => electron.ipcRenderer.invoke("new-window"),
|
|
38
39
|
getAccounts: () => electron.ipcRenderer.invoke("get-accounts"),
|
|
@@ -22388,7 +22388,7 @@ function FiArrowLeft(props) {
|
|
|
22388
22388
|
function FiAlertTriangle(props) {
|
|
22389
22389
|
return GenIcon({ "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "d": "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }, "child": [] }, { "tag": "line", "attr": { "x1": "12", "y1": "9", "x2": "12", "y2": "13" }, "child": [] }, { "tag": "line", "attr": { "x1": "12", "y1": "17", "x2": "12.01", "y2": "17" }, "child": [] }] })(props);
|
|
22390
22390
|
}
|
|
22391
|
-
function UniversalPushWizard({ isOpen, onClose }) {
|
|
22391
|
+
function UniversalPushWizard({ isOpen, onClose, onAutoHealTrigger }) {
|
|
22392
22392
|
const [step, setStep] = reactExports.useState("START");
|
|
22393
22393
|
const [errorMsg, setErrorMsg] = reactExports.useState("");
|
|
22394
22394
|
const [files, setFiles] = reactExports.useState([]);
|
|
@@ -22528,8 +22528,8 @@ function UniversalPushWizard({ isOpen, onClose }) {
|
|
|
22528
22528
|
};
|
|
22529
22529
|
const handleCommit = async () => {
|
|
22530
22530
|
setStep("PUSHING");
|
|
22531
|
+
const targetBranch = isNewBranch ? newBranchName : selectedBranch;
|
|
22531
22532
|
try {
|
|
22532
|
-
const targetBranch = isNewBranch ? newBranchName : selectedBranch;
|
|
22533
22533
|
await window.api.commitUniversalWorkspace(
|
|
22534
22534
|
workspacePath,
|
|
22535
22535
|
commitMessage || "Universal Push via GitQuickPush",
|
|
@@ -22537,8 +22537,12 @@ function UniversalPushWizard({ isOpen, onClose }) {
|
|
|
22537
22537
|
);
|
|
22538
22538
|
setStep("SUCCESS");
|
|
22539
22539
|
} catch (e) {
|
|
22540
|
-
|
|
22541
|
-
|
|
22540
|
+
if (onAutoHealTrigger) {
|
|
22541
|
+
onAutoHealTrigger(e.message, workspacePath, targetBranch);
|
|
22542
|
+
} else {
|
|
22543
|
+
setErrorMsg(e.message);
|
|
22544
|
+
setStep("ERROR");
|
|
22545
|
+
}
|
|
22542
22546
|
}
|
|
22543
22547
|
};
|
|
22544
22548
|
if (!isOpen) return null;
|
|
@@ -24229,10 +24233,11 @@ function App() {
|
|
|
24229
24233
|
setIsPulling(false);
|
|
24230
24234
|
}
|
|
24231
24235
|
};
|
|
24232
|
-
const autonomousHealAndPush = async (initialError, operation) => {
|
|
24236
|
+
const autonomousHealAndPush = async (initialError, operation, overrideRepoPath, overrideBranch) => {
|
|
24233
24237
|
let currentError = initialError;
|
|
24234
24238
|
let attempts = 0;
|
|
24235
24239
|
const maxAttempts = 5;
|
|
24240
|
+
const targetRepoPath = overrideRepoPath || repoPath;
|
|
24236
24241
|
setShowHealerOverlay(true);
|
|
24237
24242
|
setHealerMessage(`Analyzing initial ${operation} failure...`);
|
|
24238
24243
|
setHealerAttempt(1);
|
|
@@ -24240,8 +24245,11 @@ function App() {
|
|
|
24240
24245
|
attempts++;
|
|
24241
24246
|
setHealerAttempt(attempts);
|
|
24242
24247
|
try {
|
|
24248
|
+
if (overrideRepoPath) {
|
|
24249
|
+
await window.api.setRepoPath(overrideRepoPath);
|
|
24250
|
+
}
|
|
24243
24251
|
const currentStatus = await window.api.getStatus();
|
|
24244
|
-
const result = await window.api.askAi("gemini", "", currentError, currentStatus,
|
|
24252
|
+
const result = await window.api.askAi("gemini", "", currentError, currentStatus, targetRepoPath || "");
|
|
24245
24253
|
setHealerMessage(result.explanation || `Applying fix...`);
|
|
24246
24254
|
if (result.commandsToRun && result.commandsToRun.length > 0) {
|
|
24247
24255
|
for (const cmd of result.commandsToRun) {
|
|
@@ -24253,39 +24261,37 @@ function App() {
|
|
|
24253
24261
|
const remotes = await window.api.getRemotes();
|
|
24254
24262
|
if (remotes.length > 0) {
|
|
24255
24263
|
if (operation === "push") {
|
|
24256
|
-
|
|
24257
|
-
|
|
24264
|
+
const targetBranch = overrideBranch || branches.current;
|
|
24265
|
+
if (pushAllBranches && !overrideBranch) await window.api.pushAllBranches(remotes[0].name);
|
|
24266
|
+
else await window.api.pushToRemote(remotes[0].name, targetBranch);
|
|
24258
24267
|
setPushSuccessData({
|
|
24259
|
-
repository:
|
|
24260
|
-
branch:
|
|
24268
|
+
repository: targetRepoPath?.split("\\").pop() || "",
|
|
24269
|
+
branch: targetBranch,
|
|
24261
24270
|
files: 0,
|
|
24262
24271
|
commitMessage: commitMessage || "Auto-Healed Push"
|
|
24263
24272
|
});
|
|
24264
24273
|
setCommitMessage("");
|
|
24265
24274
|
setShowHealerOverlay(false);
|
|
24266
24275
|
await refreshRepoState();
|
|
24267
|
-
|
|
24268
|
-
|
|
24269
|
-
await window.api.pullFromRemote(remotes[0].name, branches.current);
|
|
24270
|
-
showToast("Auto-Healer successfully pulled changes!", "success");
|
|
24271
|
-
setShowHealerOverlay(false);
|
|
24272
|
-
await refreshRepoState();
|
|
24273
|
-
return true;
|
|
24276
|
+
} else {
|
|
24277
|
+
await window.api.pullFromRemote(remotes[0].name, overrideBranch || branches.current);
|
|
24274
24278
|
}
|
|
24279
|
+
setHealerMessage(`Successfully auto-healed and ${operation}ed!`);
|
|
24280
|
+
setTimeout(() => {
|
|
24281
|
+
setShowHealerOverlay(false);
|
|
24282
|
+
if (overrideRepoPath && repoPath) {
|
|
24283
|
+
window.api.setRepoPath(repoPath);
|
|
24284
|
+
}
|
|
24285
|
+
}, 2e3);
|
|
24286
|
+
return;
|
|
24287
|
+
} else {
|
|
24288
|
+
throw new Error("No remote found to push/pull to.");
|
|
24275
24289
|
}
|
|
24276
|
-
} catch (
|
|
24277
|
-
currentError =
|
|
24290
|
+
} catch (err) {
|
|
24291
|
+
currentError = err.message;
|
|
24278
24292
|
setHealerMessage(`Attempt ${attempts} failed. Analyzing new error...`);
|
|
24279
24293
|
}
|
|
24280
24294
|
}
|
|
24281
|
-
setShowHealerOverlay(false);
|
|
24282
|
-
setGitErrorData({
|
|
24283
|
-
msg: `AI Auto-Healer exhausted all ${maxAttempts} attempts.
|
|
24284
|
-
|
|
24285
|
-
Final Error: ${currentError}`,
|
|
24286
|
-
status: await window.api.getStatus()
|
|
24287
|
-
});
|
|
24288
|
-
await refreshRepoState();
|
|
24289
24295
|
return false;
|
|
24290
24296
|
};
|
|
24291
24297
|
const confirmPush = async () => {
|
|
@@ -26289,7 +26295,11 @@ Final Error: ${currentError}`,
|
|
|
26289
26295
|
UniversalPushWizard,
|
|
26290
26296
|
{
|
|
26291
26297
|
isOpen: showUniversalWizard,
|
|
26292
|
-
onClose: () => setShowUniversalWizard(false)
|
|
26298
|
+
onClose: () => setShowUniversalWizard(false),
|
|
26299
|
+
onAutoHealTrigger: (msg, path, branch) => {
|
|
26300
|
+
setShowUniversalWizard(false);
|
|
26301
|
+
autonomousHealAndPush(msg, "push", path, branch);
|
|
26302
|
+
}
|
|
26293
26303
|
}
|
|
26294
26304
|
),
|
|
26295
26305
|
(isPushing || isPulling || isUnlocking) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "absolute inset-0 bg-black/80 backdrop-blur-md flex flex-col items-center justify-center z-[100] transition-opacity", children: [
|
package/out/renderer/index.html
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap"
|
|
22
22
|
rel="stylesheet"
|
|
23
23
|
/>
|
|
24
|
-
<script type="module" crossorigin src="./assets/index-
|
|
24
|
+
<script type="module" crossorigin src="./assets/index-BFVPEjGX.js"></script>
|
|
25
25
|
<link rel="stylesheet" crossorigin href="./assets/index-DsltCz9R.css">
|
|
26
26
|
</head>
|
|
27
27
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gitxelectron",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "An elegant, completely silent auto-syncing Git client. Works as a desktop app and npm CLI tool.",
|
|
5
5
|
"main": "./out/main/index.js",
|
|
6
6
|
"files": [
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
"bin"
|
|
9
9
|
],
|
|
10
10
|
"bin": {
|
|
11
|
-
"
|
|
12
|
-
"gitquickpush": "./bin/cli.js"
|
|
11
|
+
"gitxelectron": "./bin/cli.js"
|
|
13
12
|
},
|
|
14
13
|
"author": "GitElectron <support@gitelectron.com>",
|
|
15
14
|
"license": "MIT",
|
|
@@ -69,4 +68,4 @@
|
|
|
69
68
|
"typescript": "^5.9.3",
|
|
70
69
|
"vite": "^7.2.6"
|
|
71
70
|
}
|
|
72
|
-
}
|
|
71
|
+
}
|