@sideboard-ai/core 0.1.67 → 0.1.71
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/{agents-OTBZVTZO.js → agents-GB7XL2LI.js} +8 -7
- package/dist/{agents-TS3EI2YI.js → agents-TCAK3MXN.js} +8 -7
- package/dist/{app-settings-ONKMFSEJ.js → app-settings-3TLA2EJ7.js} +16 -1
- package/dist/{app-settings-GJVZGU3M.js → app-settings-P42Z3VOB.js} +16 -1
- package/dist/caffeinate-hold-BEJIYPJ7.js +107 -0
- package/dist/caffeinate-hold-KLC6SABD.js +14 -0
- package/dist/{chunk-WAFIF22N.js → chunk-3CY6WJ7O.js} +2 -2
- package/dist/{chunk-7ZOQY4A7.js → chunk-57ROTAFD.js} +62 -3
- package/dist/{chunk-57WWNMFP.js → chunk-7NCIHRAU.js} +22 -4
- package/dist/{chunk-FGDJOJ2L.js → chunk-AE5VBOFE.js} +1 -1
- package/dist/{chunk-DB3I75FI.js → chunk-BTL7EMGT.js} +4 -4
- package/dist/{chunk-4UIYN56C.js → chunk-D4DPQ552.js} +1 -1
- package/dist/{chunk-JWZNK3CQ.js → chunk-DGPUAZA4.js} +62 -3
- package/dist/{chunk-ZRFAZVGL.js → chunk-H2IXNFQ2.js} +22 -4
- package/dist/chunk-JAWEDVVA.js +106 -0
- package/dist/chunk-JT7R45JB.js +20 -0
- package/dist/{chunk-4BUCGNZS.js → chunk-MF2YMEGD.js} +83 -29
- package/dist/{chunk-K7LM4CLD.js → chunk-NG7S3OPX.js} +12 -6
- package/dist/chunk-NSTQ6QKD.js +23 -0
- package/dist/{chunk-LW5CMQGZ.js → chunk-OE7YBB5X.js} +83 -29
- package/dist/{chunk-BPOTVI5J.js → chunk-PTJJIQK7.js} +472 -18
- package/dist/{chunk-B4PRRKMA.js → chunk-S25IHL5H.js} +12 -6
- package/dist/{chunk-5HTTCYWA.js → chunk-UH57WVFP.js} +2 -2
- package/dist/{chunk-M5V4QIWF.js → chunk-VROPG6QF.js} +1 -1
- package/dist/{chunk-MHR4OGZ4.js → chunk-W7YOTDVO.js} +493 -18
- package/dist/{connected-teams-RUNMOCG5.js → connected-teams-35EIRJCP.js} +2 -2
- package/dist/{connected-teams-OMDHTL6A.js → connected-teams-ZRS53OAT.js} +2 -2
- package/dist/{coordinator-prompt-6HMTOX4G.js → coordinator-prompt-2J4PIMUF.js} +7 -4
- package/dist/{coordinator-prompt-3BSMKZL4.js → coordinator-prompt-QYYG2IBB.js} +7 -4
- package/dist/{global-workspace-YZ2NJVLL.js → global-workspace-KHIFQUUM.js} +12 -5
- package/dist/{global-workspace-QS7A23CB.js → global-workspace-SVRYNJZA.js} +12 -5
- package/dist/index.cjs +4805 -1262
- package/dist/index.d.cts +570 -22
- package/dist/index.d.ts +570 -22
- package/dist/index.js +3084 -340
- package/dist/mcp/run-stdio.cjs +2339 -617
- package/dist/mcp/run-stdio.js +1289 -290
- package/dist/{run-Y2MI3EVV.js → run-A4RHY7HH.js} +1 -1
- package/dist/{run-JLD2Y52J.js → run-V2WZUMJA.js} +1 -1
- package/dist/{workspaces-EBFW7I7S.js → workspaces-AHFTHVBT.js} +7 -6
- package/dist/{workspaces-AIUYUXB7.js → workspaces-SVQIEVIZ.js} +7 -6
- package/dist/{worktree-WMDJW2BL.js → worktree-KWXHMKRN.js} +2 -2
- package/dist/{worktree-7NBPIVFZ.js → worktree-VOCH3WS3.js} +2 -2
- package/package.json +3 -1
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
gh,
|
|
11
11
|
git,
|
|
12
12
|
resolveGhAuthToken
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-AE5VBOFE.js";
|
|
14
14
|
import {
|
|
15
15
|
worktreesRoot
|
|
16
16
|
} from "./chunk-7MV3RXSC.js";
|
|
@@ -882,6 +882,10 @@ function formatGhLandError(raw, opts) {
|
|
|
882
882
|
}
|
|
883
883
|
|
|
884
884
|
// src/git/pr-gates.ts
|
|
885
|
+
function prIsInMergeQueue(gate) {
|
|
886
|
+
if (gate.isInMergeQueue) return true;
|
|
887
|
+
return (gate.mergeStateStatus ?? "").toUpperCase() === "QUEUED";
|
|
888
|
+
}
|
|
885
889
|
function buildMergeGateChecks(gate, opts = {}) {
|
|
886
890
|
const rows = [];
|
|
887
891
|
const base = gate.baseRefName?.trim() || "the base branch";
|
|
@@ -891,7 +895,8 @@ function buildMergeGateChecks(gate, opts = {}) {
|
|
|
891
895
|
const review = (gate.reviewDecision ?? "").toUpperCase();
|
|
892
896
|
const suppressBlocked = opts.suppressGenericBlocked !== false;
|
|
893
897
|
const conflicting = mergeable === "CONFLICTING" || mergeState === "DIRTY";
|
|
894
|
-
|
|
898
|
+
const inQueue = prIsInMergeQueue(gate);
|
|
899
|
+
if (conflicting && !inQueue) {
|
|
895
900
|
rows.push({
|
|
896
901
|
name: "Merge conflicts",
|
|
897
902
|
state: mergeable === "CONFLICTING" ? "CONFLICTING" : mergeState || "DIRTY",
|
|
@@ -903,6 +908,18 @@ function buildMergeGateChecks(gate, opts = {}) {
|
|
|
903
908
|
workflow: "mergeability",
|
|
904
909
|
kind: "mergeability"
|
|
905
910
|
});
|
|
911
|
+
} else if (inQueue) {
|
|
912
|
+
rows.push({
|
|
913
|
+
name: "Merge queue",
|
|
914
|
+
state: "QUEUED",
|
|
915
|
+
bucket: "pending",
|
|
916
|
+
startedAt: null,
|
|
917
|
+
completedAt: null,
|
|
918
|
+
link,
|
|
919
|
+
description: `This pull request is in the GitHub merge queue for ${base}.`,
|
|
920
|
+
workflow: "mergeability",
|
|
921
|
+
kind: "mergeability"
|
|
922
|
+
});
|
|
906
923
|
} else if (mergeState === "BEHIND") {
|
|
907
924
|
rows.push({
|
|
908
925
|
name: "Branch behind",
|
|
@@ -1241,7 +1258,7 @@ async function originGhRepoEnv(cwd) {
|
|
|
1241
1258
|
const slug = await resolveGithubRepoSlug(cwd);
|
|
1242
1259
|
return slug ? { GH_REPO: slug } : {};
|
|
1243
1260
|
}
|
|
1244
|
-
async function resolveDefaultBranch(repoPath) {
|
|
1261
|
+
async function resolveDefaultBranch(repoPath, opts) {
|
|
1245
1262
|
const viaOrigin = await git(
|
|
1246
1263
|
["symbolic-ref", "refs/remotes/origin/HEAD"],
|
|
1247
1264
|
repoPath,
|
|
@@ -1250,22 +1267,24 @@ async function resolveDefaultBranch(repoPath) {
|
|
|
1250
1267
|
if (viaOrigin.exitCode === 0 && viaOrigin.stdout.trim()) {
|
|
1251
1268
|
return viaOrigin.stdout.trim().replace(/^refs\/remotes\/origin\//, "");
|
|
1252
1269
|
}
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1270
|
+
if (opts?.network !== false) {
|
|
1271
|
+
const slug = await resolveGithubRepoSlug(repoPath);
|
|
1272
|
+
const viaGh = await gh(
|
|
1273
|
+
[
|
|
1274
|
+
"repo",
|
|
1275
|
+
"view",
|
|
1276
|
+
...slug ? ["--repo", slug] : [],
|
|
1277
|
+
"--json",
|
|
1278
|
+
"defaultBranchRef",
|
|
1279
|
+
"--jq",
|
|
1280
|
+
".defaultBranchRef.name"
|
|
1281
|
+
],
|
|
1282
|
+
repoPath,
|
|
1283
|
+
{ reject: false, timeoutMs: 8e3 }
|
|
1284
|
+
);
|
|
1285
|
+
if (viaGh.exitCode === 0 && viaGh.stdout.trim()) {
|
|
1286
|
+
return viaGh.stdout.trim();
|
|
1287
|
+
}
|
|
1269
1288
|
}
|
|
1270
1289
|
for (const candidate of ["main", "master"]) {
|
|
1271
1290
|
const check = await git(
|
|
@@ -1406,10 +1425,21 @@ async function fetchPrMergeGate(cwd, selector, slug) {
|
|
|
1406
1425
|
"view",
|
|
1407
1426
|
selector,
|
|
1408
1427
|
"--json",
|
|
1409
|
-
"mergeable,mergeStateStatus,reviewDecision,baseRefName,url"
|
|
1428
|
+
"mergeable,mergeStateStatus,reviewDecision,baseRefName,url,isInMergeQueue"
|
|
1410
1429
|
];
|
|
1411
1430
|
if (slug) args.push("--repo", slug);
|
|
1412
|
-
|
|
1431
|
+
let { stdout, exitCode, stderr } = await gh(args, cwd, { reject: false });
|
|
1432
|
+
if (exitCode !== 0 && isUnknownJsonField(stderr, "isInMergeQueue")) {
|
|
1433
|
+
const retry = [
|
|
1434
|
+
"pr",
|
|
1435
|
+
"view",
|
|
1436
|
+
selector,
|
|
1437
|
+
"--json",
|
|
1438
|
+
"mergeable,mergeStateStatus,reviewDecision,baseRefName,url"
|
|
1439
|
+
];
|
|
1440
|
+
if (slug) retry.push("--repo", slug);
|
|
1441
|
+
({ stdout, exitCode, stderr } = await gh(retry, cwd, { reject: false }));
|
|
1442
|
+
}
|
|
1413
1443
|
if (exitCode !== 0 || !stdout.trim()) {
|
|
1414
1444
|
if (/no pull requests found/i.test(stderr)) return null;
|
|
1415
1445
|
return null;
|
|
@@ -1421,12 +1451,22 @@ async function fetchPrMergeGate(cwd, selector, slug) {
|
|
|
1421
1451
|
mergeStateStatus: typeof view.mergeStateStatus === "string" && view.mergeStateStatus ? view.mergeStateStatus : null,
|
|
1422
1452
|
reviewDecision: typeof view.reviewDecision === "string" && view.reviewDecision ? view.reviewDecision : null,
|
|
1423
1453
|
baseRefName: typeof view.baseRefName === "string" && view.baseRefName ? view.baseRefName : null,
|
|
1424
|
-
url: typeof view.url === "string" && view.url ? view.url : null
|
|
1454
|
+
url: typeof view.url === "string" && view.url ? view.url : null,
|
|
1455
|
+
isInMergeQueue: parseInMergeQueue(view)
|
|
1425
1456
|
};
|
|
1426
1457
|
} catch {
|
|
1427
1458
|
return null;
|
|
1428
1459
|
}
|
|
1429
1460
|
}
|
|
1461
|
+
function isUnknownJsonField(stderr, field) {
|
|
1462
|
+
return new RegExp(`unknown json field[^\\n]*${field}`, "i").test(stderr);
|
|
1463
|
+
}
|
|
1464
|
+
function parseInMergeQueue(view) {
|
|
1465
|
+
return prIsInMergeQueue({
|
|
1466
|
+
isInMergeQueue: view.isInMergeQueue === true,
|
|
1467
|
+
mergeStateStatus: typeof view.mergeStateStatus === "string" ? view.mergeStateStatus : null
|
|
1468
|
+
});
|
|
1469
|
+
}
|
|
1430
1470
|
async function detectLocalMergeConflicts(cwd, baseRefName) {
|
|
1431
1471
|
const baseName = (baseRefName?.trim() || await resolveDefaultBranch(cwd)).replace(
|
|
1432
1472
|
/^origin\//,
|
|
@@ -1487,7 +1527,8 @@ async function getPrChecks(cwd, selector) {
|
|
|
1487
1527
|
const mergeable = (gate?.mergeable ?? "").toUpperCase();
|
|
1488
1528
|
const mergeState = (gate?.mergeStateStatus ?? "").toUpperCase();
|
|
1489
1529
|
const alreadyConflicting = mergeable === "CONFLICTING" || mergeState === "DIRTY";
|
|
1490
|
-
const
|
|
1530
|
+
const inQueue = gate ? prIsInMergeQueue(gate) : false;
|
|
1531
|
+
const needsLocalProbe = !alreadyConflicting && !inQueue;
|
|
1491
1532
|
if (needsLocalProbe) {
|
|
1492
1533
|
try {
|
|
1493
1534
|
const local = await detectLocalMergeConflicts(cwd, gate?.baseRefName ?? null);
|
|
@@ -1498,7 +1539,8 @@ async function getPrChecks(cwd, selector) {
|
|
|
1498
1539
|
mergeStateStatus: "DIRTY",
|
|
1499
1540
|
reviewDecision: gate?.reviewDecision ?? null,
|
|
1500
1541
|
baseRefName: local.base,
|
|
1501
|
-
url: gate?.url ?? null
|
|
1542
|
+
url: gate?.url ?? null,
|
|
1543
|
+
isInMergeQueue: false
|
|
1502
1544
|
};
|
|
1503
1545
|
const ciFailed2 = ciChecks.some((c) => c.bucket === "fail");
|
|
1504
1546
|
const review2 = (gate.reviewDecision ?? "").toUpperCase();
|
|
@@ -1542,10 +1584,21 @@ async function getPrMeta(cwd, selector) {
|
|
|
1542
1584
|
"view",
|
|
1543
1585
|
selector,
|
|
1544
1586
|
"--json",
|
|
1545
|
-
"number,title,url,state,isDraft,reviewDecision,baseRefName,headRefName"
|
|
1587
|
+
"number,title,url,state,isDraft,reviewDecision,baseRefName,headRefName,isInMergeQueue,mergeStateStatus"
|
|
1546
1588
|
];
|
|
1547
1589
|
if (slug) viewArgs.push("--repo", slug);
|
|
1548
|
-
|
|
1590
|
+
let { stdout, exitCode, stderr } = await gh(viewArgs, cwd, { reject: false });
|
|
1591
|
+
if (exitCode !== 0 && isUnknownJsonField(stderr, "isInMergeQueue")) {
|
|
1592
|
+
const retry = [
|
|
1593
|
+
"pr",
|
|
1594
|
+
"view",
|
|
1595
|
+
selector,
|
|
1596
|
+
"--json",
|
|
1597
|
+
"number,title,url,state,isDraft,reviewDecision,baseRefName,headRefName,mergeStateStatus"
|
|
1598
|
+
];
|
|
1599
|
+
if (slug) retry.push("--repo", slug);
|
|
1600
|
+
({ stdout, exitCode, stderr } = await gh(retry, cwd, { reject: false }));
|
|
1601
|
+
}
|
|
1549
1602
|
if (exitCode !== 0 || !stdout.trim()) {
|
|
1550
1603
|
if (/no pull requests found/i.test(stderr)) return null;
|
|
1551
1604
|
return null;
|
|
@@ -1560,7 +1613,8 @@ async function getPrMeta(cwd, selector) {
|
|
|
1560
1613
|
isDraft: Boolean(view.isDraft),
|
|
1561
1614
|
reviewDecision: typeof view.reviewDecision === "string" && view.reviewDecision ? view.reviewDecision : null,
|
|
1562
1615
|
baseRefName: String(view.baseRefName ?? ""),
|
|
1563
|
-
headRefName: String(view.headRefName ?? "")
|
|
1616
|
+
headRefName: String(view.headRefName ?? ""),
|
|
1617
|
+
isInMergeQueue: parseInMergeQueue(view)
|
|
1564
1618
|
};
|
|
1565
1619
|
} catch {
|
|
1566
1620
|
return null;
|
|
@@ -1917,11 +1971,11 @@ async function listWorktrees(repoPath) {
|
|
|
1917
1971
|
return entries;
|
|
1918
1972
|
}
|
|
1919
1973
|
async function isDirty(worktreePath) {
|
|
1920
|
-
const { stdout } = await git(["status", "--porcelain"
|
|
1974
|
+
const { stdout } = await git(["status", "--porcelain"], worktreePath);
|
|
1921
1975
|
for (const line of stdout.split("\n")) {
|
|
1922
1976
|
if (!line.trim()) continue;
|
|
1923
1977
|
const rel = porcelainStatusPath(line);
|
|
1924
|
-
if (!rel || isSideboardScratchPath(rel)) continue;
|
|
1978
|
+
if (!rel || isSideboardScratchPath(rel) || rel === ".sideboard") continue;
|
|
1925
1979
|
return true;
|
|
1926
1980
|
}
|
|
1927
1981
|
return false;
|