@kage-core/kage-graph-mcp 2.2.0 → 2.2.1
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/kernel.js +21 -5
- package/package.json +1 -1
package/dist/kernel.js
CHANGED
|
@@ -16152,13 +16152,13 @@ function resolvePacketSyncConflict(memoryDir, file) {
|
|
|
16152
16152
|
function rebaseOntoUpstream(memoryDir, upstream) {
|
|
16153
16153
|
const conflictBackups = [];
|
|
16154
16154
|
let resolved = 0;
|
|
16155
|
-
let step = runSyncGit(memoryDir, ["-c", "core.editor=true", "rebase", upstream]);
|
|
16155
|
+
let step = runSyncGit(memoryDir, [...syncIdentityArgs(memoryDir), "-c", "core.editor=true", "rebase", upstream]);
|
|
16156
16156
|
while (!step.ok) {
|
|
16157
16157
|
const conflicted = runSyncGit(memoryDir, ["diff", "--name-only", "--diff-filter=U"])
|
|
16158
16158
|
.stdout.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
16159
16159
|
if (!conflicted.length) {
|
|
16160
16160
|
// The resolved commit became empty (we kept the upstream side wholesale).
|
|
16161
|
-
const skip = runSyncGit(memoryDir, ["-c", "core.editor=true", "rebase", "--skip"]);
|
|
16161
|
+
const skip = runSyncGit(memoryDir, [...syncIdentityArgs(memoryDir), "-c", "core.editor=true", "rebase", "--skip"]);
|
|
16162
16162
|
if (skip.ok) {
|
|
16163
16163
|
step = skip;
|
|
16164
16164
|
continue;
|
|
@@ -16182,7 +16182,7 @@ function rebaseOntoUpstream(memoryDir, upstream) {
|
|
|
16182
16182
|
const toAdd = [file, ...(resolution.backupPath ? [(0, node_path_1.relative)(memoryDir, resolution.backupPath)] : [])];
|
|
16183
16183
|
runSyncGit(memoryDir, ["add", "--", ...toAdd]);
|
|
16184
16184
|
}
|
|
16185
|
-
step = runSyncGit(memoryDir, ["-c", "core.editor=true", "rebase", "--continue"]);
|
|
16185
|
+
step = runSyncGit(memoryDir, [...syncIdentityArgs(memoryDir), "-c", "core.editor=true", "rebase", "--continue"]);
|
|
16186
16186
|
}
|
|
16187
16187
|
return { ok: true, resolved, conflictBackups };
|
|
16188
16188
|
}
|
|
@@ -16267,9 +16267,25 @@ function syncSetup(remoteUrl) {
|
|
|
16267
16267
|
}
|
|
16268
16268
|
}
|
|
16269
16269
|
result.branch = runSyncGit(memoryDir, ["rev-parse", "--abbrev-ref", "HEAD"]).stdout || null;
|
|
16270
|
-
|
|
16270
|
+
let push = runSyncGit(memoryDir, ["push", "-u", "origin", "HEAD"]);
|
|
16271
|
+
if (!push.ok && /non-fast-forward|behind|fetch first/i.test(push.stderr)) {
|
|
16272
|
+
// Some git versions leave the local branch behind the remote after the
|
|
16273
|
+
// convergence rebase (observed on CI's git, not on macOS). A second
|
|
16274
|
+
// fetch + rebase fast-forwards a behind branch, after which push succeeds.
|
|
16275
|
+
runSyncGit(memoryDir, ["fetch", "origin"]);
|
|
16276
|
+
const retryBranch = syncRemoteDefaultBranch(memoryDir) ?? result.branch;
|
|
16277
|
+
if (retryBranch && runSyncGit(memoryDir, ["rev-parse", "--verify", "--quiet", `origin/${retryBranch}`]).ok) {
|
|
16278
|
+
runSyncGit(memoryDir, ["branch", "-M", retryBranch]);
|
|
16279
|
+
const retryRebase = rebaseOntoUpstream(memoryDir, `origin/${retryBranch}`);
|
|
16280
|
+
if (retryRebase.ok)
|
|
16281
|
+
push = runSyncGit(memoryDir, ["push", "-u", "origin", "HEAD"]);
|
|
16282
|
+
}
|
|
16283
|
+
}
|
|
16271
16284
|
if (!push.ok) {
|
|
16272
|
-
|
|
16285
|
+
const state = runSyncGit(memoryDir, ["log", "--oneline", "--all", "--decorate", "-n", "8"]).stdout;
|
|
16286
|
+
result.errors.push(`git push failed: ${push.stderr}${state ? `
|
|
16287
|
+
repo state:
|
|
16288
|
+
${state}` : ""}`);
|
|
16273
16289
|
return result;
|
|
16274
16290
|
}
|
|
16275
16291
|
result.pushed = true;
|