@knowsuchagency/fulcrum 5.9.4 → 5.9.5
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/bin/fulcrum.js +4 -4
- package/package.json +1 -1
- package/server/index.js +80 -9
package/bin/fulcrum.js
CHANGED
|
@@ -46869,7 +46869,7 @@ async function runMcpServer(urlOverride, portOverride) {
|
|
|
46869
46869
|
const client = new FulcrumClient(urlOverride, portOverride);
|
|
46870
46870
|
const server = new McpServer({
|
|
46871
46871
|
name: "fulcrum",
|
|
46872
|
-
version: "5.9.
|
|
46872
|
+
version: "5.9.5"
|
|
46873
46873
|
});
|
|
46874
46874
|
registerTools(server, client);
|
|
46875
46875
|
const transport = new StdioServerTransport;
|
|
@@ -49218,7 +49218,7 @@ var marketplace_default = `{
|
|
|
49218
49218
|
"name": "fulcrum",
|
|
49219
49219
|
"source": "./",
|
|
49220
49220
|
"description": "Task orchestration for Claude Code",
|
|
49221
|
-
"version": "5.9.
|
|
49221
|
+
"version": "5.9.5",
|
|
49222
49222
|
"skills": [
|
|
49223
49223
|
"./skills/fulcrum"
|
|
49224
49224
|
],
|
|
@@ -49241,7 +49241,7 @@ var marketplace_default = `{
|
|
|
49241
49241
|
var plugin_default = `{
|
|
49242
49242
|
"name": "fulcrum",
|
|
49243
49243
|
"description": "Fulcrum task orchestration for Claude Code",
|
|
49244
|
-
"version": "5.9.
|
|
49244
|
+
"version": "5.9.5",
|
|
49245
49245
|
"author": {
|
|
49246
49246
|
"name": "Fulcrum"
|
|
49247
49247
|
},
|
|
@@ -50258,7 +50258,7 @@ function compareVersions(v1, v2) {
|
|
|
50258
50258
|
var package_default = {
|
|
50259
50259
|
name: "@knowsuchagency/fulcrum",
|
|
50260
50260
|
private: true,
|
|
50261
|
-
version: "5.9.
|
|
50261
|
+
version: "5.9.5",
|
|
50262
50262
|
description: "Harness Attention. Orchestrate Agents. Ship.",
|
|
50263
50263
|
license: "PolyForm-Perimeter-1.0.0",
|
|
50264
50264
|
type: "module",
|
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -1172278,6 +1172278,7 @@ var init_esm6 = __esm(() => {
|
|
|
1172278
1172278
|
// server/lib/git-utils.ts
|
|
1172279
1172279
|
var exports_git_utils = {};
|
|
1172280
1172280
|
__export(exports_git_utils, {
|
|
1172281
|
+
resolveLocalBranch: () => resolveLocalBranch,
|
|
1172281
1172282
|
isGitUrl: () => isGitUrl,
|
|
1172282
1172283
|
gitPull: () => gitPull,
|
|
1172283
1172284
|
fetchIfRemoteRef: () => fetchIfRemoteRef,
|
|
@@ -1172308,14 +1172309,14 @@ function extractRepoNameFromUrl(url) {
|
|
|
1172308
1172309
|
}
|
|
1172309
1172310
|
return cleaned;
|
|
1172310
1172311
|
}
|
|
1172311
|
-
function
|
|
1172312
|
+
function parseRemoteRef(repoPath, baseBranch) {
|
|
1172312
1172313
|
const slashIndex = baseBranch.indexOf("/");
|
|
1172313
1172314
|
if (slashIndex <= 0)
|
|
1172314
|
-
return;
|
|
1172315
|
+
return null;
|
|
1172315
1172316
|
const remoteName = baseBranch.slice(0, slashIndex);
|
|
1172316
1172317
|
const branchName = baseBranch.slice(slashIndex + 1);
|
|
1172317
1172318
|
if (!branchName)
|
|
1172318
|
-
return;
|
|
1172319
|
+
return null;
|
|
1172319
1172320
|
try {
|
|
1172320
1172321
|
const remotes = execSync4("git remote", {
|
|
1172321
1172322
|
cwd: repoPath,
|
|
@@ -1172324,18 +1172325,76 @@ function fetchIfRemoteRef(repoPath, baseBranch) {
|
|
|
1172324
1172325
|
}).trim().split(`
|
|
1172325
1172326
|
`).map((r6) => r6.trim()).filter(Boolean);
|
|
1172326
1172327
|
if (!remotes.includes(remoteName))
|
|
1172327
|
-
return;
|
|
1172328
|
+
return null;
|
|
1172328
1172329
|
} catch {
|
|
1172329
|
-
return;
|
|
1172330
|
+
return null;
|
|
1172330
1172331
|
}
|
|
1172332
|
+
return { remoteName, branchName };
|
|
1172333
|
+
}
|
|
1172334
|
+
function fetchIfRemoteRef(repoPath, baseBranch) {
|
|
1172335
|
+
const parsed = parseRemoteRef(repoPath, baseBranch);
|
|
1172336
|
+
if (!parsed)
|
|
1172337
|
+
return;
|
|
1172331
1172338
|
try {
|
|
1172332
|
-
execSync4(`git fetch ${remoteName} ${branchName}`, {
|
|
1172339
|
+
execSync4(`git fetch ${parsed.remoteName} ${parsed.branchName}`, {
|
|
1172333
1172340
|
cwd: repoPath,
|
|
1172334
1172341
|
encoding: "utf-8",
|
|
1172335
1172342
|
timeout: 30000
|
|
1172336
1172343
|
});
|
|
1172337
1172344
|
} catch {}
|
|
1172338
1172345
|
}
|
|
1172346
|
+
function resolveLocalBranch(repoPath, baseBranch) {
|
|
1172347
|
+
const parsed = parseRemoteRef(repoPath, baseBranch);
|
|
1172348
|
+
if (!parsed) {
|
|
1172349
|
+
return baseBranch;
|
|
1172350
|
+
}
|
|
1172351
|
+
const { remoteName, branchName } = parsed;
|
|
1172352
|
+
fetchIfRemoteRef(repoPath, baseBranch);
|
|
1172353
|
+
let currentBranch = "";
|
|
1172354
|
+
try {
|
|
1172355
|
+
currentBranch = execSync4("git rev-parse --abbrev-ref HEAD", {
|
|
1172356
|
+
cwd: repoPath,
|
|
1172357
|
+
encoding: "utf-8",
|
|
1172358
|
+
timeout: 1e4
|
|
1172359
|
+
}).trim();
|
|
1172360
|
+
} catch {}
|
|
1172361
|
+
let localExists = false;
|
|
1172362
|
+
try {
|
|
1172363
|
+
execSync4(`git rev-parse --verify ${branchName}`, {
|
|
1172364
|
+
cwd: repoPath,
|
|
1172365
|
+
encoding: "utf-8",
|
|
1172366
|
+
timeout: 1e4,
|
|
1172367
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
1172368
|
+
});
|
|
1172369
|
+
localExists = true;
|
|
1172370
|
+
} catch {
|
|
1172371
|
+
localExists = false;
|
|
1172372
|
+
}
|
|
1172373
|
+
if (localExists) {
|
|
1172374
|
+
if (currentBranch !== branchName) {
|
|
1172375
|
+
try {
|
|
1172376
|
+
execSync4(`git fetch ${remoteName} ${branchName}:${branchName}`, {
|
|
1172377
|
+
cwd: repoPath,
|
|
1172378
|
+
encoding: "utf-8",
|
|
1172379
|
+
timeout: 30000,
|
|
1172380
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
1172381
|
+
});
|
|
1172382
|
+
} catch {}
|
|
1172383
|
+
}
|
|
1172384
|
+
return branchName;
|
|
1172385
|
+
}
|
|
1172386
|
+
try {
|
|
1172387
|
+
execSync4(`git branch ${branchName} ${baseBranch}`, {
|
|
1172388
|
+
cwd: repoPath,
|
|
1172389
|
+
encoding: "utf-8",
|
|
1172390
|
+
timeout: 1e4,
|
|
1172391
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
1172392
|
+
});
|
|
1172393
|
+
return branchName;
|
|
1172394
|
+
} catch {
|
|
1172395
|
+
return null;
|
|
1172396
|
+
}
|
|
1172397
|
+
}
|
|
1172339
1172398
|
function gitPull(repoPath) {
|
|
1172340
1172399
|
try {
|
|
1172341
1172400
|
execSync4("git pull", {
|
|
@@ -1227502,7 +1227561,13 @@ app3.post("/merge-to-main", async (c2) => {
|
|
|
1227502
1227561
|
if (dirtyCheck) {
|
|
1227503
1227562
|
return c2.json(dirtyCheck, 409);
|
|
1227504
1227563
|
}
|
|
1227505
|
-
const
|
|
1227564
|
+
const rawDefaultBranch = getDefaultBranch(repoPath, baseBranch);
|
|
1227565
|
+
const defaultBranch = resolveLocalBranch(repoPath, rawDefaultBranch);
|
|
1227566
|
+
if (!defaultBranch) {
|
|
1227567
|
+
return c2.json({
|
|
1227568
|
+
error: `Could not resolve ${rawDefaultBranch} to a local branch. Create or check out a local branch tracking ${rawDefaultBranch} and try again.`
|
|
1227569
|
+
}, 400);
|
|
1227570
|
+
}
|
|
1227506
1227571
|
let originalBranch;
|
|
1227507
1227572
|
try {
|
|
1227508
1227573
|
originalBranch = gitExec(repoPath, "rev-parse --abbrev-ref HEAD");
|
|
@@ -1227595,7 +1227660,13 @@ app3.post("/sync-parent", async (c2) => {
|
|
|
1227595
1227660
|
if (!fs12.existsSync(repoPath)) {
|
|
1227596
1227661
|
return c2.json({ error: "Repository path does not exist" }, 404);
|
|
1227597
1227662
|
}
|
|
1227598
|
-
const
|
|
1227663
|
+
const rawDefaultBranch = getDefaultBranch(repoPath, baseBranch);
|
|
1227664
|
+
const defaultBranch = resolveLocalBranch(repoPath, rawDefaultBranch);
|
|
1227665
|
+
if (!defaultBranch) {
|
|
1227666
|
+
return c2.json({
|
|
1227667
|
+
error: `Could not resolve ${rawDefaultBranch} to a local branch. Create or check out a local branch tracking ${rawDefaultBranch} and try again.`
|
|
1227668
|
+
}, 400);
|
|
1227669
|
+
}
|
|
1227599
1227670
|
let originalBranch;
|
|
1227600
1227671
|
try {
|
|
1227601
1227672
|
originalBranch = gitExec(repoPath, "rev-parse --abbrev-ref HEAD");
|
|
@@ -1272924,7 +1272995,7 @@ mcpRoutes.all("/", async (c2) => {
|
|
|
1272924
1272995
|
});
|
|
1272925
1272996
|
const server2 = new McpServer({
|
|
1272926
1272997
|
name: "fulcrum",
|
|
1272927
|
-
version: "5.9.
|
|
1272998
|
+
version: "5.9.5"
|
|
1272928
1272999
|
});
|
|
1272929
1273000
|
const client3 = new FulcrumClient(`http://localhost:${port}`);
|
|
1272930
1273001
|
registerTools(server2, client3);
|