@sideboard-ai/core 0.1.88 → 0.1.92
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/cursor-runner.cjs +176 -15
- package/dist/agents/cursor-runner.js +11 -2
- package/dist/{agents-LMUFTGKF.js → agents-JXQ5QHDU.js} +4 -4
- package/dist/{agents-ODBP7J6E.js → agents-TUV4NH7S.js} +5 -5
- package/dist/{chunk-RJLBSYUO.js → chunk-35LKGGOC.js} +45 -77
- package/dist/{chunk-WANQFU3S.js → chunk-6XBXVXX2.js} +2 -2
- package/dist/{chunk-7D27DD2X.js → chunk-CIRXAYWS.js} +260 -61
- package/dist/{chunk-B2KIO2SD.js → chunk-CLGO7TLO.js} +2 -2
- package/dist/{chunk-JE75QW2I.js → chunk-GJ2HJQIU.js} +236 -96
- package/dist/{chunk-CBJSPTBG.js → chunk-GXSYI7FH.js} +206 -5
- package/dist/chunk-MMI4RJ5I.js +46 -0
- package/dist/{chunk-UHTNJKZX.js → chunk-NR6APJLD.js} +2 -2
- package/dist/{chunk-6EZRSCIT.js → chunk-QKYO6BHB.js} +2 -2
- package/dist/{chunk-ZXYWWSHZ.js → chunk-R7BQBSDT.js} +254 -61
- package/dist/{chunk-OB6IRIFV.js → chunk-XH2GS2LO.js} +2 -2
- package/dist/{chunk-VZ2L4AEJ.js → chunk-XUWDLRAE.js} +2 -2
- package/dist/{coordinator-prompt-UK5LYFN5.js → coordinator-prompt-AKEY4WSO.js} +2 -2
- package/dist/{coordinator-prompt-CI5SHONJ.js → coordinator-prompt-OQOOD5ET.js} +2 -2
- package/dist/{global-workspace-2YZ2V4I5.js → global-workspace-3GNPQCLE.js} +3 -3
- package/dist/{global-workspace-JQQLPJM5.js → global-workspace-M3OMVDDH.js} +3 -3
- package/dist/index.cjs +998 -463
- package/dist/index.d.cts +77 -19
- package/dist/index.d.ts +77 -19
- package/dist/index.js +181 -50
- package/dist/mcp/run-stdio.cjs +872 -436
- package/dist/mcp/run-stdio.js +132 -48
- package/dist/{workspaces-YWCC3WV4.js → workspaces-ERZC7ULY.js} +4 -4
- package/dist/{workspaces-FDO5L4NI.js → workspaces-J4WG6UFR.js} +4 -4
- package/dist/{worktree-7YNSJ224.js → worktree-DA4BOV7G.js} +7 -1
- package/dist/{worktree-4555QBQ7.js → worktree-EO5QAGJU.js} +7 -1
- package/package.json +1 -1
package/dist/mcp/run-stdio.js
CHANGED
|
@@ -17,14 +17,14 @@ import {
|
|
|
17
17
|
resolveQuotaFallbackAgent,
|
|
18
18
|
sideboardMcpProfile,
|
|
19
19
|
summarizeTurnStderr
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-GJ2HJQIU.js";
|
|
21
21
|
import "../chunk-DKHGWYWR.js";
|
|
22
22
|
import {
|
|
23
23
|
addWorkspace,
|
|
24
24
|
ensureWorkspace,
|
|
25
25
|
removeWorkspace,
|
|
26
26
|
syncWorkspacesFromThreads
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-6XBXVXX2.js";
|
|
28
28
|
import {
|
|
29
29
|
extractPresentedPlan,
|
|
30
30
|
readPlanFile,
|
|
@@ -42,14 +42,14 @@ import {
|
|
|
42
42
|
isGlobalThread,
|
|
43
43
|
isOrchestratorThread,
|
|
44
44
|
orchestratorSessionPoisonedByBuiltins
|
|
45
|
-
} from "../chunk-
|
|
45
|
+
} from "../chunk-NR6APJLD.js";
|
|
46
46
|
import {
|
|
47
47
|
SLACK_REPLY_FORMATTING,
|
|
48
48
|
coordinatorSystemPrompt,
|
|
49
49
|
coordinatorTurnReminder,
|
|
50
50
|
enrichWorkspacesWithGithub,
|
|
51
51
|
ensureGlobalCoordinatorCwd
|
|
52
|
-
} from "../chunk-
|
|
52
|
+
} from "../chunk-XH2GS2LO.js";
|
|
53
53
|
import {
|
|
54
54
|
addPrStackLayer,
|
|
55
55
|
allocateTeamName,
|
|
@@ -66,6 +66,7 @@ import {
|
|
|
66
66
|
getPr,
|
|
67
67
|
getPrChecks,
|
|
68
68
|
getPrDetails,
|
|
69
|
+
getPrForHeadBranch,
|
|
69
70
|
getPrMeta,
|
|
70
71
|
getPrStack,
|
|
71
72
|
initPrStack,
|
|
@@ -75,6 +76,7 @@ import {
|
|
|
75
76
|
listBranches,
|
|
76
77
|
listPrs,
|
|
77
78
|
listWorktrees,
|
|
79
|
+
mergeAgentGitAuthEnv,
|
|
78
80
|
mergePr,
|
|
79
81
|
normalizeWorktreePath,
|
|
80
82
|
originGhRepoEnv,
|
|
@@ -85,11 +87,13 @@ import {
|
|
|
85
87
|
resolveDiffBaseRef,
|
|
86
88
|
resolveGithubRepoSlug,
|
|
87
89
|
resolvePrSelector,
|
|
90
|
+
resolvePrSelectors,
|
|
88
91
|
resolveRepoRoot,
|
|
89
92
|
takenSlugsFromThread,
|
|
90
93
|
threadDisplayLabel,
|
|
94
|
+
warmGithubAgentAuth,
|
|
91
95
|
worktreeNameFromPath
|
|
92
|
-
} from "../chunk-
|
|
96
|
+
} from "../chunk-R7BQBSDT.js";
|
|
93
97
|
import {
|
|
94
98
|
ATTACHMENTS_DIR,
|
|
95
99
|
LEGACY_ATTACHMENTS_DIR,
|
|
@@ -888,6 +892,49 @@ function normalizeParseResult(parsed) {
|
|
|
888
892
|
return Array.isArray(parsed) ? parsed : [parsed];
|
|
889
893
|
}
|
|
890
894
|
|
|
895
|
+
// src/agents/cursor-stream-coalesce.ts
|
|
896
|
+
function isTextEvent(event) {
|
|
897
|
+
return event.type === "stdout" || event.type === "thinking";
|
|
898
|
+
}
|
|
899
|
+
function createAgentStreamCoalescer(emit, opts) {
|
|
900
|
+
const intervalMs = opts?.intervalMs ?? 32;
|
|
901
|
+
let pending = null;
|
|
902
|
+
let timer = null;
|
|
903
|
+
const flush = () => {
|
|
904
|
+
if (timer) {
|
|
905
|
+
clearTimeout(timer);
|
|
906
|
+
timer = null;
|
|
907
|
+
}
|
|
908
|
+
if (!pending) return;
|
|
909
|
+
const event = pending;
|
|
910
|
+
pending = null;
|
|
911
|
+
emit({ type: event.type, data: event.data });
|
|
912
|
+
};
|
|
913
|
+
const schedule = () => {
|
|
914
|
+
if (timer) return;
|
|
915
|
+
timer = setTimeout(flush, intervalMs);
|
|
916
|
+
timer.unref?.();
|
|
917
|
+
};
|
|
918
|
+
return {
|
|
919
|
+
push(event) {
|
|
920
|
+
if (!isTextEvent(event)) {
|
|
921
|
+
flush();
|
|
922
|
+
emit(event);
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
if (!event.data) return;
|
|
926
|
+
if (pending && pending.type === event.type) {
|
|
927
|
+
pending.data += event.data;
|
|
928
|
+
} else {
|
|
929
|
+
flush();
|
|
930
|
+
pending = { type: event.type, data: event.data };
|
|
931
|
+
}
|
|
932
|
+
schedule();
|
|
933
|
+
},
|
|
934
|
+
flush
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
|
|
891
938
|
// src/agents/spawn.ts
|
|
892
939
|
async function spawnAgentTurn(thread, input, onEvent) {
|
|
893
940
|
ensureAgentPath();
|
|
@@ -896,9 +943,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
896
943
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
897
944
|
);
|
|
898
945
|
}
|
|
899
|
-
const { isGlobalThread: isGlobalThread2 } = await import("../global-workspace-
|
|
946
|
+
const { isGlobalThread: isGlobalThread2 } = await import("../global-workspace-3GNPQCLE.js");
|
|
900
947
|
if (isGlobalThread2(thread)) {
|
|
901
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("../coordinator-prompt-
|
|
948
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("../coordinator-prompt-OQOOD5ET.js");
|
|
902
949
|
ensureGlobalCoordinatorCwd2(
|
|
903
950
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
904
951
|
);
|
|
@@ -916,10 +963,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
916
963
|
const env = childEnvWithAppSettings(cmd.env);
|
|
917
964
|
try {
|
|
918
965
|
if (isOrchestratorThread(thread)) {
|
|
919
|
-
|
|
966
|
+
mergeAgentGitAuthEnv(env, await resolveAgentGitAuthEnv(env));
|
|
920
967
|
} else {
|
|
921
|
-
|
|
922
|
-
Object.assign(env, originEnv);
|
|
968
|
+
mergeAgentGitAuthEnv(env, await originGhRepoEnv(thread.worktreePath, { env }));
|
|
923
969
|
}
|
|
924
970
|
} catch (err) {
|
|
925
971
|
const detail = err instanceof Error ? err.message : String(err);
|
|
@@ -943,12 +989,13 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
943
989
|
let assistantText = "";
|
|
944
990
|
let parts = [];
|
|
945
991
|
let usage = null;
|
|
992
|
+
const outbound = createAgentStreamCoalescer(onEvent);
|
|
946
993
|
const consume = (stream, kind) => {
|
|
947
994
|
if (!stream) return;
|
|
948
995
|
const rl = createInterface({ input: stream, crlfDelay: Infinity });
|
|
949
996
|
rl.on("line", (line) => {
|
|
950
997
|
if (kind === "stderr") {
|
|
951
|
-
|
|
998
|
+
outbound.push({ type: "stderr", data: line });
|
|
952
999
|
return;
|
|
953
1000
|
}
|
|
954
1001
|
let events = normalizeParseResult(adapter.parseEvent(line));
|
|
@@ -963,12 +1010,12 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
963
1010
|
for (const parsed of events) {
|
|
964
1011
|
if (parsed.type === "session_id") {
|
|
965
1012
|
sessionId = parsed.data;
|
|
966
|
-
|
|
1013
|
+
outbound.push(parsed);
|
|
967
1014
|
continue;
|
|
968
1015
|
}
|
|
969
1016
|
if (parsed.type === "usage") {
|
|
970
1017
|
usage = applyTurnUsage(usage, parsed.data, parsed.scope ?? "request");
|
|
971
|
-
|
|
1018
|
+
outbound.push(parsed);
|
|
972
1019
|
continue;
|
|
973
1020
|
}
|
|
974
1021
|
if (parsed.type === "stdout") {
|
|
@@ -981,13 +1028,14 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
981
1028
|
assistantText += parsed.data;
|
|
982
1029
|
}
|
|
983
1030
|
parts = applyAgentEvent(parts, parsed);
|
|
984
|
-
|
|
1031
|
+
outbound.push(parsed);
|
|
985
1032
|
}
|
|
986
1033
|
});
|
|
987
1034
|
};
|
|
988
1035
|
consume(child.stdout, "stdout");
|
|
989
1036
|
consume(child.stderr, "stderr");
|
|
990
1037
|
const done = child.then((result) => {
|
|
1038
|
+
outbound.flush();
|
|
991
1039
|
const exitCode = result.exitCode ?? null;
|
|
992
1040
|
onEvent({ type: "exit", data: exitCode });
|
|
993
1041
|
const finalized = finalizeParts(parts);
|
|
@@ -1306,7 +1354,10 @@ async function spawnWorkspaceScript(command, opts) {
|
|
|
1306
1354
|
loginEnv
|
|
1307
1355
|
);
|
|
1308
1356
|
try {
|
|
1309
|
-
|
|
1357
|
+
mergeAgentGitAuthEnv(
|
|
1358
|
+
env,
|
|
1359
|
+
await resolveAgentGitAuthEnv(env, { cwd: opts.worktreePath })
|
|
1360
|
+
);
|
|
1310
1361
|
} catch {
|
|
1311
1362
|
}
|
|
1312
1363
|
const shell = process.platform === "darwin" ? "zsh" : "bash";
|
|
@@ -1740,6 +1791,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
1740
1791
|
let sourceRef = input.sourceRef;
|
|
1741
1792
|
let sourceIsFork = false;
|
|
1742
1793
|
let prUrl = null;
|
|
1794
|
+
let prTitle = null;
|
|
1743
1795
|
if (input.sourceType === "pr") {
|
|
1744
1796
|
const num = Number(input.sourceRef.replace(/^#/, ""));
|
|
1745
1797
|
if (!Number.isFinite(num)) throw new Error(`Invalid PR number: ${input.sourceRef}`);
|
|
@@ -1755,6 +1807,12 @@ async function createThread(input, _onSetupLine) {
|
|
|
1755
1807
|
} else if (input.sourceType === "branch") {
|
|
1756
1808
|
if (!sourceRef || sourceRef === "HEAD" || sourceRef === "default") {
|
|
1757
1809
|
sourceRef = await resolveDefaultBranch(repoPath);
|
|
1810
|
+
} else {
|
|
1811
|
+
const existing = await getPrForHeadBranch(repoPath, sourceRef);
|
|
1812
|
+
if (existing?.url) {
|
|
1813
|
+
prUrl = existing.url;
|
|
1814
|
+
prTitle = existing.title;
|
|
1815
|
+
}
|
|
1758
1816
|
}
|
|
1759
1817
|
} else if (input.sourceType === "adopt") {
|
|
1760
1818
|
throw new Error("Use adoptThread() for adopt sources");
|
|
@@ -1785,14 +1843,15 @@ async function createThread(input, _onSetupLine) {
|
|
|
1785
1843
|
sourceIsFork,
|
|
1786
1844
|
parentThreadId: input.parentThreadId ?? null,
|
|
1787
1845
|
status: "idle",
|
|
1788
|
-
prUrl
|
|
1846
|
+
prUrl,
|
|
1847
|
+
prTitle
|
|
1789
1848
|
});
|
|
1790
1849
|
writeThread(thread);
|
|
1791
1850
|
await ensureWorkspace(repoPath);
|
|
1792
1851
|
return readThread(thread.id) ?? thread;
|
|
1793
1852
|
}
|
|
1794
1853
|
async function listLinearIssues(agent, repoPath) {
|
|
1795
|
-
const { getAdapter: getAdapter2 } = await import("../agents-
|
|
1854
|
+
const { getAdapter: getAdapter2 } = await import("../agents-JXQ5QHDU.js");
|
|
1796
1855
|
await requireAgent(agent, { requireLinear: true });
|
|
1797
1856
|
const adapter = getAdapter2(agent);
|
|
1798
1857
|
if (!adapter.listLinearIssues) {
|
|
@@ -2583,7 +2642,7 @@ import {
|
|
|
2583
2642
|
} from "fs";
|
|
2584
2643
|
import { tmpdir } from "os";
|
|
2585
2644
|
import { join as join8 } from "path";
|
|
2586
|
-
import
|
|
2645
|
+
import { createRequire } from "module";
|
|
2587
2646
|
var CONDUCTOR_APP_SUPPORT = join8(
|
|
2588
2647
|
process.env.HOME ?? "",
|
|
2589
2648
|
"Library",
|
|
@@ -2592,6 +2651,11 @@ var CONDUCTOR_APP_SUPPORT = join8(
|
|
|
2592
2651
|
);
|
|
2593
2652
|
var CONDUCTOR_DB = join8(CONDUCTOR_APP_SUPPORT, "conductor.db");
|
|
2594
2653
|
var CURSOR_SDK_STORE = join8(CONDUCTOR_APP_SUPPORT, "cursor-sdk-store");
|
|
2654
|
+
function openReadonlySqlite(file) {
|
|
2655
|
+
const req = createRequire(import.meta.url);
|
|
2656
|
+
const Database = req("better-sqlite3");
|
|
2657
|
+
return new Database(file, { readonly: true, fileMustExist: true });
|
|
2658
|
+
}
|
|
2595
2659
|
function mapAgentType(raw) {
|
|
2596
2660
|
if (!raw) return null;
|
|
2597
2661
|
const v = raw.toLowerCase();
|
|
@@ -2660,7 +2724,7 @@ async function adoptThread(input) {
|
|
|
2660
2724
|
messages: input.messages ?? []
|
|
2661
2725
|
});
|
|
2662
2726
|
writeThread(thread);
|
|
2663
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("../workspaces-
|
|
2727
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("../workspaces-J4WG6UFR.js");
|
|
2664
2728
|
await ensureWorkspace2(repoPath);
|
|
2665
2729
|
return thread;
|
|
2666
2730
|
}
|
|
@@ -2681,7 +2745,7 @@ function listConductorWorkspaces() {
|
|
|
2681
2745
|
}
|
|
2682
2746
|
}
|
|
2683
2747
|
}
|
|
2684
|
-
const db =
|
|
2748
|
+
const db = openReadonlySqlite(snapshot);
|
|
2685
2749
|
try {
|
|
2686
2750
|
const tables = db.prepare(`SELECT name FROM sqlite_master WHERE type='table'`).all();
|
|
2687
2751
|
const names = new Set(tables.map((t) => t.name));
|
|
@@ -2772,7 +2836,7 @@ function importConductorWorkspace(workspaceId) {
|
|
|
2772
2836
|
}
|
|
2773
2837
|
}
|
|
2774
2838
|
}
|
|
2775
|
-
const db =
|
|
2839
|
+
const db = openReadonlySqlite(snapshot);
|
|
2776
2840
|
try {
|
|
2777
2841
|
const row = db.prepare(
|
|
2778
2842
|
`SELECT
|
|
@@ -4504,9 +4568,10 @@ function formatArtifactDirective() {
|
|
|
4504
4568
|
"Files / media browser (CMS file manager column):",
|
|
4505
4569
|
"4) Call Sideboard MCP `present_files` with optional title, path, and datasource (brightsy|memory).",
|
|
4506
4570
|
" Opens the Files column for browse/upload/pick. Do NOT say a file manager UI is missing.",
|
|
4507
|
-
"Multiple-choice questions
|
|
4508
|
-
"5) Call Sideboard MCP `ask_user` when
|
|
4509
|
-
"
|
|
4571
|
+
"Multiple-choice questions:",
|
|
4572
|
+
"5) Call Sideboard MCP `ask_user` only when work is blocked on choosing among a few concrete options (approach forks, which API, auth vs cookies). First write a short chat message that explains the decision and what each option means (tradeoffs, when to pick it). Include a description on every option. After calling, stop and wait for their next message with answers. If you are asking a real multiple-choice, use ask_user rather than chat bullets so Sideboard shows the composer picker.",
|
|
4573
|
+
"Do not call ask_user for greetings, check-ins, \u201Chello\u201D, open-ended how-can-I-help, or to invent a menu of possible next tasks \u2014 reply in chat. If one option is the obvious default, proceed without asking.",
|
|
4574
|
+
"Never say artifacts, CMS UI, or the Files column are unavailable. Prefer present_schema for list/edit/publish; present_files for storage UI; html fences for standalone pages; ask_user only for those blocked predefined-option questions."
|
|
4510
4575
|
].join("\n");
|
|
4511
4576
|
}
|
|
4512
4577
|
function formatUiReminder() {
|
|
@@ -4517,7 +4582,7 @@ function formatUiReminder() {
|
|
|
4517
4582
|
"CMS forms/tables: MCP present_schema (Brightsy resource_id or inline schema+schemaUi).",
|
|
4518
4583
|
"Files column: MCP present_files (brightsy account storage or memory).",
|
|
4519
4584
|
"Do not say artifacts/CMS UI are unavailable.",
|
|
4520
|
-
"
|
|
4585
|
+
"ask_user: only when blocked on a real multiple-choice (approach fork, which API). Never for hellos, check-ins, or \u201Cwhat next?\u201D menus \u2014 reply in chat."
|
|
4521
4586
|
].join(" ");
|
|
4522
4587
|
}
|
|
4523
4588
|
|
|
@@ -5136,10 +5201,12 @@ var Orchestrator = class {
|
|
|
5136
5201
|
if (event.type === "stderr" && typeof event.data === "string") {
|
|
5137
5202
|
pushTurnStderr(stderrTail, event.data);
|
|
5138
5203
|
}
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5204
|
+
if (event.type !== "stdout" && event.type !== "thinking") {
|
|
5205
|
+
const live = readThread(threadId);
|
|
5206
|
+
if (live?.lastError?.includes("reconciled on startup") && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
|
|
5207
|
+
setStatus(threadId, "running");
|
|
5208
|
+
this.emit({ type: "status_changed", threadId, status: "running" });
|
|
5209
|
+
}
|
|
5143
5210
|
}
|
|
5144
5211
|
}
|
|
5145
5212
|
);
|
|
@@ -5723,8 +5790,9 @@ var Orchestrator = class {
|
|
|
5723
5790
|
return result;
|
|
5724
5791
|
}
|
|
5725
5792
|
async mergePr(threadRef) {
|
|
5726
|
-
const { thread,
|
|
5793
|
+
const { thread, selectors, cwd } = await this.withPrSelector(threadRef);
|
|
5727
5794
|
this.assertNotGlobal(thread, "Merge PR");
|
|
5795
|
+
const selector = selectors[0];
|
|
5728
5796
|
if (!selector) throw new Error("No pull request linked to this thread");
|
|
5729
5797
|
const result = await mergePr(cwd, selector);
|
|
5730
5798
|
const state = normalizePrState(result.state) || "MERGED";
|
|
@@ -5744,29 +5812,34 @@ var Orchestrator = class {
|
|
|
5744
5812
|
await this.persistPrMetaAndMaybeArchive(thread, metaLike);
|
|
5745
5813
|
return { url: metaLike.url, state };
|
|
5746
5814
|
}
|
|
5747
|
-
/** Resolve PR
|
|
5815
|
+
/** Resolve PR selectors and optionally persist `prUrl` when found. */
|
|
5748
5816
|
async withPrSelector(threadRef) {
|
|
5749
5817
|
const thread = this.requireThread(threadRef);
|
|
5750
|
-
const
|
|
5818
|
+
const selectors = resolvePrSelectors(thread);
|
|
5751
5819
|
const cwd = thread.worktreePath;
|
|
5752
5820
|
if (!cwd?.trim()) {
|
|
5753
5821
|
throw new Error(`Thread ${threadRef} has no worktreePath`);
|
|
5754
5822
|
}
|
|
5755
|
-
return { thread,
|
|
5823
|
+
return { thread, selectors, cwd };
|
|
5756
5824
|
}
|
|
5757
5825
|
async getPrChecks(threadRef) {
|
|
5758
|
-
const {
|
|
5759
|
-
|
|
5760
|
-
|
|
5826
|
+
const { selectors, cwd } = await this.withPrSelector(threadRef);
|
|
5827
|
+
for (const selector of selectors) {
|
|
5828
|
+
const checks = await getPrChecks(cwd, selector);
|
|
5829
|
+
if (checks) return checks;
|
|
5830
|
+
}
|
|
5831
|
+
return null;
|
|
5761
5832
|
}
|
|
5762
5833
|
async getPrMeta(threadRef) {
|
|
5763
|
-
const { thread,
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5834
|
+
const { thread, selectors, cwd } = await this.withPrSelector(threadRef);
|
|
5835
|
+
for (const selector of selectors) {
|
|
5836
|
+
const meta = await getPrMeta(cwd, selector);
|
|
5837
|
+
if (meta) {
|
|
5838
|
+
await this.persistPrMetaAndMaybeArchive(thread, meta);
|
|
5839
|
+
return meta;
|
|
5840
|
+
}
|
|
5768
5841
|
}
|
|
5769
|
-
return
|
|
5842
|
+
return null;
|
|
5770
5843
|
}
|
|
5771
5844
|
/**
|
|
5772
5845
|
* Persist PR URL/title/state and Conductor-style auto-archive when the PR
|
|
@@ -5890,9 +5963,12 @@ var Orchestrator = class {
|
|
|
5890
5963
|
return { stack: result.stack, threads: result.threads };
|
|
5891
5964
|
}
|
|
5892
5965
|
async getPrDetails(threadRef) {
|
|
5893
|
-
const { thread,
|
|
5894
|
-
|
|
5895
|
-
const
|
|
5966
|
+
const { thread, selectors, cwd } = await this.withPrSelector(threadRef);
|
|
5967
|
+
let details = null;
|
|
5968
|
+
for (const selector of selectors) {
|
|
5969
|
+
details = await getPrDetails(cwd, selector);
|
|
5970
|
+
if (details) break;
|
|
5971
|
+
}
|
|
5896
5972
|
if (details) {
|
|
5897
5973
|
const patch = {};
|
|
5898
5974
|
if (details.url && details.url !== thread.prUrl) patch.prUrl = details.url;
|
|
@@ -6077,7 +6153,7 @@ var Orchestrator = class {
|
|
|
6077
6153
|
this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
|
|
6078
6154
|
if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
|
|
6079
6155
|
try {
|
|
6080
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("../workspaces-
|
|
6156
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("../workspaces-J4WG6UFR.js");
|
|
6081
6157
|
await ensureWorkspace2(thread.repoPath);
|
|
6082
6158
|
} catch {
|
|
6083
6159
|
}
|
|
@@ -6120,7 +6196,7 @@ var Orchestrator = class {
|
|
|
6120
6196
|
return restored2;
|
|
6121
6197
|
}
|
|
6122
6198
|
if (!existsSync14(thread.worktreePath)) {
|
|
6123
|
-
const { createThreadWorktree: createThreadWorktree2 } = await import("../worktree-
|
|
6199
|
+
const { createThreadWorktree: createThreadWorktree2 } = await import("../worktree-EO5QAGJU.js");
|
|
6124
6200
|
const { execa: execa5 } = await import("execa");
|
|
6125
6201
|
const slug = thread.worktreePath.split("/").pop();
|
|
6126
6202
|
const dest = thread.worktreePath;
|
|
@@ -7290,6 +7366,14 @@ function withTimeout(promise, ms, label) {
|
|
|
7290
7366
|
}
|
|
7291
7367
|
async function startMcpServer() {
|
|
7292
7368
|
const orch = getOrchestrator();
|
|
7369
|
+
try {
|
|
7370
|
+
await warmGithubAgentAuth();
|
|
7371
|
+
} catch (err) {
|
|
7372
|
+
console.error(
|
|
7373
|
+
"[sideboard-mcp] GitHub agent auth warm skipped:",
|
|
7374
|
+
err instanceof Error ? err.message : err
|
|
7375
|
+
);
|
|
7376
|
+
}
|
|
7293
7377
|
try {
|
|
7294
7378
|
const { maxConcurrentAgents } = await import("../app-settings-ZXPAB3QN.js");
|
|
7295
7379
|
orch.setMaxConcurrent(maxConcurrentAgents());
|
|
@@ -7396,7 +7480,7 @@ async function startMcpServer() {
|
|
|
7396
7480
|
);
|
|
7397
7481
|
server.tool(
|
|
7398
7482
|
"ask_user",
|
|
7399
|
-
"Ask the user clarifying multiple-choice
|
|
7483
|
+
"Ask the user a clarifying multiple-choice question in Sideboard\u2019s composer. Call only when work is blocked on choosing among a few concrete options (approach fork, which API, auth vs cookies). Do not call for greetings, check-ins, \u201Chello\u201D, open-ended how-can-I-help, or to invent a menu of possible next tasks \u2014 reply in chat instead. If one option is the obvious default, proceed without asking. Before calling, write a short chat message explaining the decision and what each option means. Include a description on every option. After calling, stop and wait for answers. Not for \u201Cis the plan ready?\u201D.",
|
|
7400
7484
|
{
|
|
7401
7485
|
questions: z3.array(
|
|
7402
7486
|
z3.object({
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
listWorkspaces,
|
|
5
5
|
removeWorkspace,
|
|
6
6
|
syncWorkspacesFromThreads
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-QKYO6BHB.js";
|
|
8
|
+
import "./chunk-CLGO7TLO.js";
|
|
9
|
+
import "./chunk-XUWDLRAE.js";
|
|
10
|
+
import "./chunk-CIRXAYWS.js";
|
|
11
11
|
import "./chunk-FKOIHGKV.js";
|
|
12
12
|
import "./chunk-FT2SQOL4.js";
|
|
13
13
|
import "./chunk-TLPJHLLM.js";
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
listWorkspaces,
|
|
7
7
|
removeWorkspace,
|
|
8
8
|
syncWorkspacesFromThreads
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-6XBXVXX2.js";
|
|
10
|
+
import "./chunk-NR6APJLD.js";
|
|
11
|
+
import "./chunk-XH2GS2LO.js";
|
|
12
|
+
import "./chunk-R7BQBSDT.js";
|
|
13
13
|
import "./chunk-B3SJXYIJ.js";
|
|
14
14
|
import "./chunk-JOF3XIEM.js";
|
|
15
15
|
import "./chunk-6LFV4VFI.js";
|
|
@@ -15,10 +15,12 @@ import {
|
|
|
15
15
|
getPr,
|
|
16
16
|
getPrChecks,
|
|
17
17
|
getPrDetails,
|
|
18
|
+
getPrForHeadBranch,
|
|
18
19
|
getPrMeta,
|
|
19
20
|
ghHeadRef,
|
|
20
21
|
ghRepoSelectArgs,
|
|
21
22
|
githubAgentGitEnv,
|
|
23
|
+
isDefaultishSourceRef,
|
|
22
24
|
isDirty,
|
|
23
25
|
isPlaceholderBranch,
|
|
24
26
|
isSideboardScratchPath,
|
|
@@ -36,6 +38,7 @@ import {
|
|
|
36
38
|
resolveDiffBaseRef,
|
|
37
39
|
resolveGithubRepoSlug,
|
|
38
40
|
resolvePrSelector,
|
|
41
|
+
resolvePrSelectors,
|
|
39
42
|
resolveRepoRoot,
|
|
40
43
|
resolveWorktreeStartPoint,
|
|
41
44
|
slugify,
|
|
@@ -44,7 +47,7 @@ import {
|
|
|
44
47
|
worktreeDisplayLabel,
|
|
45
48
|
worktreeDisplayLabelForGroup,
|
|
46
49
|
worktreeNameFromPath
|
|
47
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-CIRXAYWS.js";
|
|
48
51
|
import "./chunk-FKOIHGKV.js";
|
|
49
52
|
import "./chunk-FT2SQOL4.js";
|
|
50
53
|
import "./chunk-TLPJHLLM.js";
|
|
@@ -70,10 +73,12 @@ export {
|
|
|
70
73
|
getPr,
|
|
71
74
|
getPrChecks,
|
|
72
75
|
getPrDetails,
|
|
76
|
+
getPrForHeadBranch,
|
|
73
77
|
getPrMeta,
|
|
74
78
|
ghHeadRef,
|
|
75
79
|
ghRepoSelectArgs,
|
|
76
80
|
githubAgentGitEnv,
|
|
81
|
+
isDefaultishSourceRef,
|
|
77
82
|
isDirty,
|
|
78
83
|
isPlaceholderBranch,
|
|
79
84
|
isSideboardScratchPath,
|
|
@@ -91,6 +96,7 @@ export {
|
|
|
91
96
|
resolveDiffBaseRef,
|
|
92
97
|
resolveGithubRepoSlug,
|
|
93
98
|
resolvePrSelector,
|
|
99
|
+
resolvePrSelectors,
|
|
94
100
|
resolveRepoRoot,
|
|
95
101
|
resolveWorktreeStartPoint,
|
|
96
102
|
slugify,
|
|
@@ -17,10 +17,12 @@ import {
|
|
|
17
17
|
getPr,
|
|
18
18
|
getPrChecks,
|
|
19
19
|
getPrDetails,
|
|
20
|
+
getPrForHeadBranch,
|
|
20
21
|
getPrMeta,
|
|
21
22
|
ghHeadRef,
|
|
22
23
|
ghRepoSelectArgs,
|
|
23
24
|
githubAgentGitEnv,
|
|
25
|
+
isDefaultishSourceRef,
|
|
24
26
|
isDirty,
|
|
25
27
|
isPlaceholderBranch,
|
|
26
28
|
isSideboardScratchPath,
|
|
@@ -38,6 +40,7 @@ import {
|
|
|
38
40
|
resolveDiffBaseRef,
|
|
39
41
|
resolveGithubRepoSlug,
|
|
40
42
|
resolvePrSelector,
|
|
43
|
+
resolvePrSelectors,
|
|
41
44
|
resolveRepoRoot,
|
|
42
45
|
resolveWorktreeStartPoint,
|
|
43
46
|
slugify,
|
|
@@ -46,7 +49,7 @@ import {
|
|
|
46
49
|
worktreeDisplayLabel,
|
|
47
50
|
worktreeDisplayLabelForGroup,
|
|
48
51
|
worktreeNameFromPath
|
|
49
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-R7BQBSDT.js";
|
|
50
53
|
import "./chunk-B3SJXYIJ.js";
|
|
51
54
|
import "./chunk-JOF3XIEM.js";
|
|
52
55
|
import "./chunk-6LFV4VFI.js";
|
|
@@ -71,10 +74,12 @@ export {
|
|
|
71
74
|
getPr,
|
|
72
75
|
getPrChecks,
|
|
73
76
|
getPrDetails,
|
|
77
|
+
getPrForHeadBranch,
|
|
74
78
|
getPrMeta,
|
|
75
79
|
ghHeadRef,
|
|
76
80
|
ghRepoSelectArgs,
|
|
77
81
|
githubAgentGitEnv,
|
|
82
|
+
isDefaultishSourceRef,
|
|
78
83
|
isDirty,
|
|
79
84
|
isPlaceholderBranch,
|
|
80
85
|
isSideboardScratchPath,
|
|
@@ -92,6 +97,7 @@ export {
|
|
|
92
97
|
resolveDiffBaseRef,
|
|
93
98
|
resolveGithubRepoSlug,
|
|
94
99
|
resolvePrSelector,
|
|
100
|
+
resolvePrSelectors,
|
|
95
101
|
resolveRepoRoot,
|
|
96
102
|
resolveWorktreeStartPoint,
|
|
97
103
|
slugify,
|