gitxelectron 1.1.1 → 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
@@ -444,7 +444,7 @@ function initGit(sessionId, baseDir) {
444
444
  baseDir,
445
445
  binary: "git",
446
446
  maxConcurrentProcesses: 6,
447
- unsafe: { allowUnsafeEditor: true }
447
+ unsafe: { allowUnsafeEditor: true, allowUnsafeAskPass: true, allowUnsafeCredentialHelper: true }
448
448
  };
449
449
  const git = simpleGit.simpleGit(options);
450
450
  gitSessions.set(sessionId, { git, repoPath: baseDir });
@@ -467,7 +467,7 @@ async function isGitRepo(dir) {
467
467
  }
468
468
  async function initializeRepo(sessionId, dir) {
469
469
  try {
470
- const tempGit = simpleGit.simpleGit(dir);
470
+ const tempGit = simpleGit.simpleGit({ baseDir: dir, unsafe: { allowUnsafeEditor: true, allowUnsafeAskPass: true, allowUnsafeCredentialHelper: true } });
471
471
  await tempGit.init();
472
472
  const branches = await tempGit.branchLocal();
473
473
  if (branches.all.length === 0) {
@@ -560,7 +560,7 @@ async function pushToRemote(sessionId, remote, branch) {
560
560
  const { git } = getGitSession(sessionId);
561
561
  const remotes = await getRemotes(sessionId);
562
562
  const remoteObj = remotes.find((r) => r.name === remote);
563
- const tempGit = git.env({
563
+ const tempGit = simpleGit.simpleGit({ baseDir: getGitSession(sessionId).repoPath, unsafe: { allowUnsafeEditor: true, allowUnsafeAskPass: true, allowUnsafeCredentialHelper: true } }).env({
564
564
  ...process.env,
565
565
  GCM_INTERACTIVE: "false",
566
566
  GIT_TERMINAL_PROMPT: "0",
@@ -615,7 +615,8 @@ async function getBranches(sessionId) {
615
615
  const remotes = await git.getRemotes(true);
616
616
  if (remotes.length > 0) {
617
617
  const remoteObj = remotes[0];
618
- 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,
619
620
  GCM_INTERACTIVE: "false",
620
621
  GIT_TERMINAL_PROMPT: "0",
621
622
  GIT_ASKPASS: "echo"
@@ -700,7 +701,7 @@ async function pushAllBranches(sessionId, remote) {
700
701
  const { git } = getGitSession(sessionId);
701
702
  const remotes = await getRemotes(sessionId);
702
703
  const remoteObj = remotes.find((r) => r.name === remote);
703
- const tempGit = git.env({
704
+ const tempGit = simpleGit.simpleGit({ baseDir: getGitSession(sessionId).repoPath, unsafe: { allowUnsafeEditor: true, allowUnsafeAskPass: true, allowUnsafeCredentialHelper: true } }).env({
704
705
  ...process.env,
705
706
  GCM_INTERACTIVE: "false",
706
707
  GIT_TERMINAL_PROMPT: "0",
@@ -808,7 +809,7 @@ async function setupUniversalWorkspace(sessionId, remoteUrl, branch, baseBranch,
808
809
  const tempId = crypto.randomUUID();
809
810
  const workspacePath = path__namespace.join(electron.app.getPath("temp"), `gitelectron_universal_${tempId}`);
810
811
  await fs__namespace.mkdir(workspacePath, { recursive: true });
811
- const git = simpleGit.simpleGit(workspacePath);
812
+ const git = simpleGit.simpleGit({ baseDir: workspacePath, unsafe: { allowUnsafeEditor: true, allowUnsafeAskPass: true, allowUnsafeCredentialHelper: true } });
812
813
  await git.init();
813
814
  let authUrl = remoteUrl;
814
815
  if (remoteUrl.includes("github.com")) {
@@ -868,7 +869,7 @@ async function checkUniversalCollisions(workspacePath, sourceFiles, destinationP
868
869
  };
869
870
  }
870
871
  async function getUniversalDiff(workspacePath, filePath) {
871
- const git = simpleGit.simpleGit(workspacePath);
872
+ const git = simpleGit.simpleGit({ baseDir: workspacePath, unsafe: { allowUnsafeEditor: true, allowUnsafeAskPass: true, allowUnsafeCredentialHelper: true } });
872
873
  try {
873
874
  const diff = await git.raw(["diff", "--", filePath]);
874
875
  return diff;
@@ -877,7 +878,7 @@ async function getUniversalDiff(workspacePath, filePath) {
877
878
  }
878
879
  }
879
880
  async function commitUniversalWorkspace(workspacePath, message, branch) {
880
- const git = simpleGit.simpleGit({ baseDir: workspacePath, unsafe: { allowUnsafeEditor: true } }).env({
881
+ const git = simpleGit.simpleGit({ baseDir: workspacePath, unsafe: { allowUnsafeEditor: true, allowUnsafeAskPass: true, allowUnsafeCredentialHelper: true } }).env({
881
882
  ...process.env,
882
883
  GCM_INTERACTIVE: "false",
883
884
  GIT_TERMINAL_PROMPT: "0",
@@ -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
- setErrorMsg(e.message);
22541
- setStep("ERROR");
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, repoPath || "");
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
- if (pushAllBranches) await window.api.pushAllBranches(remotes[0].name);
24257
- else await window.api.pushToRemote(remotes[0].name, branches.current);
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: repoPath?.split("\\").pop() || "",
24260
- branch: branches.current,
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
- return true;
24268
- } else if (operation === "pull") {
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 (loopError) {
24277
- currentError = loopError.message;
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: [
@@ -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-BFPlchlf.js"></script>
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.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": [
@@ -68,4 +68,4 @@
68
68
  "typescript": "^5.9.3",
69
69
  "vite": "^7.2.6"
70
70
  }
71
- }
71
+ }