@sideboard-ai/core 0.1.218 → 0.1.219
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-YABJUV3V.js → agents-IFVGY77W.js} +2 -2
- package/dist/{agents-NWJ7DFJD.js → agents-IK3U4Z2O.js} +2 -2
- package/dist/{chunk-SRFFIFW6.js → chunk-EIICOB7P.js} +9 -9
- package/dist/{chunk-FSIJGLSV.js → chunk-IAP5NXQ4.js} +36 -9
- package/dist/{chunk-XRHTRXZN.js → chunk-K642ORWF.js} +36 -9
- package/dist/{chunk-OPYBLX4V.js → chunk-N2VST3NL.js} +49 -2
- package/dist/{chunk-MW57SKKR.js → chunk-P2EAAM3H.js} +49 -2
- package/dist/{chunk-JWBPSD7Q.js → chunk-XGE6YUO6.js} +8 -8
- package/dist/{coordinator-prompt-5V7GEPBG.js → coordinator-prompt-JLMQVORO.js} +1 -1
- package/dist/{coordinator-prompt-J4QSNTKE.js → coordinator-prompt-VZ7OSRLD.js} +1 -1
- package/dist/{global-workspace-4TEMLESD.js → global-workspace-3FDAUNN2.js} +1 -1
- package/dist/{global-workspace-XPTFHMKL.js → global-workspace-QPSJEXGR.js} +1 -1
- package/dist/index.cjs +84 -9
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +5 -3
- package/dist/mcp/run-stdio.cjs +82 -9
- package/dist/mcp/run-stdio.js +3 -3
- package/dist/{orchestrator-SWRTYFHX.js → orchestrator-5VVR7LOU.js} +3 -3
- package/dist/{orchestrator-HKW3VLGX.js → orchestrator-LFC3V3AX.js} +3 -3
- package/dist/{workspaces-BCBBMMXB.js → workspaces-76W7IEKR.js} +3 -1
- package/dist/{workspaces-2HQP654Q.js → workspaces-TDBA64II.js} +3 -1
- package/package.json +1 -1
|
@@ -44,8 +44,8 @@ import {
|
|
|
44
44
|
resolveLoginCommand,
|
|
45
45
|
resolveQuotaFallbackAgent,
|
|
46
46
|
whichOnPath
|
|
47
|
-
} from "./chunk-
|
|
48
|
-
import "./chunk-
|
|
47
|
+
} from "./chunk-K642ORWF.js";
|
|
48
|
+
import "./chunk-N2VST3NL.js";
|
|
49
49
|
import "./chunk-KTZESHYH.js";
|
|
50
50
|
import "./chunk-6K64FJDD.js";
|
|
51
51
|
import "./chunk-PO4M4JAJ.js";
|
|
@@ -50,8 +50,8 @@ import {
|
|
|
50
50
|
resolveQuotaFallbackAgent,
|
|
51
51
|
turnCostUsdFromCursorUsage,
|
|
52
52
|
whichOnPath
|
|
53
|
-
} from "./chunk-
|
|
54
|
-
import "./chunk-
|
|
53
|
+
} from "./chunk-IAP5NXQ4.js";
|
|
54
|
+
import "./chunk-P2EAAM3H.js";
|
|
55
55
|
import "./chunk-SVXIJ2IC.js";
|
|
56
56
|
import "./chunk-Y4MIXGPA.js";
|
|
57
57
|
import "./chunk-VKQGAWHY.js";
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
resolveQuotaFallbackAgent,
|
|
25
25
|
stripBrightsyNdjsonNoise,
|
|
26
26
|
toolDescription
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-K642ORWF.js";
|
|
28
28
|
import {
|
|
29
29
|
SLACK_REPLY_FORMATTING,
|
|
30
30
|
addWorkspace,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
stageAbsolutePathsAsAttachments,
|
|
48
48
|
stageBuffersAsAttachments,
|
|
49
49
|
syncWorkspacesFromThreads
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-N2VST3NL.js";
|
|
51
51
|
import {
|
|
52
52
|
addPrStackLayer,
|
|
53
53
|
allocateTeamName,
|
|
@@ -482,7 +482,7 @@ async function continueSourceThread(threadId, prompt) {
|
|
|
482
482
|
await continueOnReply(threadId, prompt);
|
|
483
483
|
return;
|
|
484
484
|
}
|
|
485
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
485
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-LFC3V3AX.js");
|
|
486
486
|
await getOrchestrator2().send(threadId, prompt);
|
|
487
487
|
} catch {
|
|
488
488
|
}
|
|
@@ -900,9 +900,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
900
900
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
901
901
|
);
|
|
902
902
|
}
|
|
903
|
-
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-
|
|
903
|
+
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-3FDAUNN2.js");
|
|
904
904
|
if (isGlobalThread2(thread)) {
|
|
905
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-
|
|
905
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-JLMQVORO.js");
|
|
906
906
|
ensureGlobalCoordinatorCwd2(
|
|
907
907
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
908
908
|
);
|
|
@@ -4178,7 +4178,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
4178
4178
|
return readThread(thread.id) ?? thread;
|
|
4179
4179
|
}
|
|
4180
4180
|
async function listLinearIssues(agent, repoPath) {
|
|
4181
|
-
const { getAdapter: getAdapter2 } = await import("./agents-
|
|
4181
|
+
const { getAdapter: getAdapter2 } = await import("./agents-IFVGY77W.js");
|
|
4182
4182
|
await requireAgent(agent, { requireLinear: true });
|
|
4183
4183
|
const adapter = getAdapter2(agent);
|
|
4184
4184
|
if (!adapter.listLinearIssues) {
|
|
@@ -4651,7 +4651,7 @@ async function adoptThread(input) {
|
|
|
4651
4651
|
messages: input.messages ?? []
|
|
4652
4652
|
});
|
|
4653
4653
|
writeThread(thread);
|
|
4654
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
4654
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-76W7IEKR.js");
|
|
4655
4655
|
await ensureWorkspace2(repoPath);
|
|
4656
4656
|
const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-L32WEBX6.js");
|
|
4657
4657
|
await ensureWorktreeSideboardIgnored2(input.worktreePath);
|
|
@@ -7332,7 +7332,7 @@ function formatScheduledPrompt(name, prompt) {
|
|
|
7332
7332
|
${prompt}`;
|
|
7333
7333
|
}
|
|
7334
7334
|
async function defaultDeps() {
|
|
7335
|
-
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-
|
|
7335
|
+
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-LFC3V3AX.js");
|
|
7336
7336
|
const orch = getOrchestrator2();
|
|
7337
7337
|
return {
|
|
7338
7338
|
findThread: (id) => findThreadByRef(id),
|
|
@@ -9606,7 +9606,7 @@ var Orchestrator = class {
|
|
|
9606
9606
|
this.enforceHistoryRetention();
|
|
9607
9607
|
if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
|
|
9608
9608
|
try {
|
|
9609
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
9609
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-76W7IEKR.js");
|
|
9610
9610
|
await ensureWorkspace2(thread.repoPath);
|
|
9611
9611
|
} catch {
|
|
9612
9612
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
isOrchestratorThread
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-P2EAAM3H.js";
|
|
6
6
|
import {
|
|
7
7
|
applyConnectedTeamToCli,
|
|
8
8
|
brightsyMcpServerName,
|
|
@@ -1496,8 +1496,16 @@ function toOpencodeMcpConfigContent(servers, opts) {
|
|
|
1496
1496
|
}
|
|
1497
1497
|
return JSON.stringify({ mcp });
|
|
1498
1498
|
}
|
|
1499
|
-
function
|
|
1500
|
-
|
|
1499
|
+
function stripElectronFromUserMcpEntry(entry) {
|
|
1500
|
+
const next = { ...entry };
|
|
1501
|
+
const env = next.env;
|
|
1502
|
+
if (!env || typeof env !== "object" || Array.isArray(env)) return next;
|
|
1503
|
+
const cleaned = { ...env };
|
|
1504
|
+
delete cleaned.ELECTRON_RUN_AS_NODE;
|
|
1505
|
+
next.env = cleaned;
|
|
1506
|
+
return next;
|
|
1507
|
+
}
|
|
1508
|
+
function writeMcpServersConfig(servers, extraServers) {
|
|
1501
1509
|
const mcpServers = {};
|
|
1502
1510
|
for (const s of servers) {
|
|
1503
1511
|
const env = mcpSpawnEnv(s.env);
|
|
@@ -1507,6 +1515,14 @@ function writeMcpServersConfig(servers) {
|
|
|
1507
1515
|
...env ? { env } : {}
|
|
1508
1516
|
};
|
|
1509
1517
|
}
|
|
1518
|
+
if (extraServers) {
|
|
1519
|
+
for (const [rawName, entry] of Object.entries(extraServers)) {
|
|
1520
|
+
const name = rawName.trim();
|
|
1521
|
+
if (!name || mcpServers[name] || !entry) continue;
|
|
1522
|
+
mcpServers[name] = stripElectronFromUserMcpEntry(entry);
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
if (Object.keys(mcpServers).length === 0) return null;
|
|
1510
1526
|
const dir = mkdtempSync(join4(tmpdir(), "sideboard-mcp-"));
|
|
1511
1527
|
const cfgPath = join4(dir, "mcp.json");
|
|
1512
1528
|
writeFileSync2(cfgPath, JSON.stringify({ mcpServers }, null, 2));
|
|
@@ -1593,10 +1609,20 @@ function listUserOpencodeMcpNames(home = homedir3()) {
|
|
|
1593
1609
|
}
|
|
1594
1610
|
return names;
|
|
1595
1611
|
}
|
|
1596
|
-
function
|
|
1612
|
+
function userClaudeMcpConfigObject(home = homedir3()) {
|
|
1597
1613
|
const claudePath = home === homedir3() ? userClaudeMcpConfigPath() : join6(home, ".claude.json");
|
|
1598
|
-
if (!existsSync7(claudePath)) return
|
|
1599
|
-
return
|
|
1614
|
+
if (!existsSync7(claudePath)) return {};
|
|
1615
|
+
return asObject(asObject(readJsonObject(claudePath)).mcpServers);
|
|
1616
|
+
}
|
|
1617
|
+
function listUserClaudeMcpServerEntries(home = homedir3()) {
|
|
1618
|
+
const out = {};
|
|
1619
|
+
for (const [rawName, value] of Object.entries(userClaudeMcpConfigObject(home))) {
|
|
1620
|
+
const name = rawName.trim();
|
|
1621
|
+
if (!name || isInjectedOrchMcpName(name)) continue;
|
|
1622
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) continue;
|
|
1623
|
+
out[name] = value;
|
|
1624
|
+
}
|
|
1625
|
+
return out;
|
|
1600
1626
|
}
|
|
1601
1627
|
function toCodexDisableUserMcpArgs(names) {
|
|
1602
1628
|
const args = [];
|
|
@@ -2511,7 +2537,7 @@ var claudeAdapter = {
|
|
|
2511
2537
|
);
|
|
2512
2538
|
}
|
|
2513
2539
|
const mode = permissionMode(thread);
|
|
2514
|
-
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-
|
|
2540
|
+
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-QPSJEXGR.js");
|
|
2515
2541
|
const isOrchestrator = isOrchestratorThread2(thread);
|
|
2516
2542
|
const injectedServers = await buildInjectedMcpServers({
|
|
2517
2543
|
includeSideboard: true,
|
|
@@ -2522,6 +2548,7 @@ var claudeAdapter = {
|
|
|
2522
2548
|
});
|
|
2523
2549
|
const injectedBrightsyNames = injectedServers.filter((s) => s.name === "brightsy" || s.name.startsWith("brightsy_")).map((s) => s.name);
|
|
2524
2550
|
const chromeOn = claudeChromeEnabled();
|
|
2551
|
+
const userMcpEntries = isOrchestrator ? {} : listUserClaudeMcpServerEntries();
|
|
2525
2552
|
let allowedTools;
|
|
2526
2553
|
if (isOrchestrator) {
|
|
2527
2554
|
allowedTools = [
|
|
@@ -2532,7 +2559,7 @@ var claudeAdapter = {
|
|
|
2532
2559
|
} else {
|
|
2533
2560
|
allowedTools = [
|
|
2534
2561
|
...BASE_ALLOWED_TOOLS,
|
|
2535
|
-
...mcpAllowToolsFromNames(
|
|
2562
|
+
...mcpAllowToolsFromNames(Object.keys(userMcpEntries)),
|
|
2536
2563
|
...sideboardWorktreeAllowedTools({
|
|
2537
2564
|
github: true,
|
|
2538
2565
|
linear: isLinearConnected(),
|
|
@@ -2557,7 +2584,7 @@ var claudeAdapter = {
|
|
|
2557
2584
|
if (systemPrompt) {
|
|
2558
2585
|
args.push("--append-system-prompt", systemPrompt);
|
|
2559
2586
|
}
|
|
2560
|
-
const mcpConfigPath = writeMcpServersConfig(injectedServers);
|
|
2587
|
+
const mcpConfigPath = writeMcpServersConfig(injectedServers, userMcpEntries);
|
|
2561
2588
|
if (mcpConfigPath) {
|
|
2562
2589
|
args.push("--mcp-config", mcpConfigPath);
|
|
2563
2590
|
args.push("--strict-mcp-config");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isOrchestratorThread
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-N2VST3NL.js";
|
|
4
4
|
import {
|
|
5
5
|
codexUnattendedGitConfigArgs,
|
|
6
6
|
mergeAgentGitAuthEnv,
|
|
@@ -876,8 +876,16 @@ function toOpencodeMcpConfigContent(servers, opts) {
|
|
|
876
876
|
}
|
|
877
877
|
return JSON.stringify({ mcp });
|
|
878
878
|
}
|
|
879
|
-
function
|
|
880
|
-
|
|
879
|
+
function stripElectronFromUserMcpEntry(entry) {
|
|
880
|
+
const next = { ...entry };
|
|
881
|
+
const env = next.env;
|
|
882
|
+
if (!env || typeof env !== "object" || Array.isArray(env)) return next;
|
|
883
|
+
const cleaned = { ...env };
|
|
884
|
+
delete cleaned.ELECTRON_RUN_AS_NODE;
|
|
885
|
+
next.env = cleaned;
|
|
886
|
+
return next;
|
|
887
|
+
}
|
|
888
|
+
function writeMcpServersConfig(servers, extraServers) {
|
|
881
889
|
const mcpServers = {};
|
|
882
890
|
for (const s of servers) {
|
|
883
891
|
const env = mcpSpawnEnv(s.env);
|
|
@@ -887,6 +895,14 @@ function writeMcpServersConfig(servers) {
|
|
|
887
895
|
...env ? { env } : {}
|
|
888
896
|
};
|
|
889
897
|
}
|
|
898
|
+
if (extraServers) {
|
|
899
|
+
for (const [rawName, entry] of Object.entries(extraServers)) {
|
|
900
|
+
const name = rawName.trim();
|
|
901
|
+
if (!name || mcpServers[name] || !entry) continue;
|
|
902
|
+
mcpServers[name] = stripElectronFromUserMcpEntry(entry);
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
if (Object.keys(mcpServers).length === 0) return null;
|
|
890
906
|
const dir = mkdtempSync(join(tmpdir(), "sideboard-mcp-"));
|
|
891
907
|
const cfgPath = join(dir, "mcp.json");
|
|
892
908
|
writeFileSync(cfgPath, JSON.stringify({ mcpServers }, null, 2));
|
|
@@ -1037,10 +1053,20 @@ function listUserOpencodeMcpNames(home = homedir2()) {
|
|
|
1037
1053
|
}
|
|
1038
1054
|
return names;
|
|
1039
1055
|
}
|
|
1040
|
-
function
|
|
1056
|
+
function userClaudeMcpConfigObject(home = homedir2()) {
|
|
1041
1057
|
const claudePath = home === homedir2() ? userClaudeMcpConfigPath() : join3(home, ".claude.json");
|
|
1042
|
-
if (!existsSync4(claudePath)) return
|
|
1043
|
-
return
|
|
1058
|
+
if (!existsSync4(claudePath)) return {};
|
|
1059
|
+
return asObject2(asObject2(readJsonObject(claudePath)).mcpServers);
|
|
1060
|
+
}
|
|
1061
|
+
function listUserClaudeMcpServerEntries(home = homedir2()) {
|
|
1062
|
+
const out = {};
|
|
1063
|
+
for (const [rawName, value] of Object.entries(userClaudeMcpConfigObject(home))) {
|
|
1064
|
+
const name = rawName.trim();
|
|
1065
|
+
if (!name || isInjectedOrchMcpName(name)) continue;
|
|
1066
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) continue;
|
|
1067
|
+
out[name] = value;
|
|
1068
|
+
}
|
|
1069
|
+
return out;
|
|
1044
1070
|
}
|
|
1045
1071
|
function toCodexDisableUserMcpArgs(names) {
|
|
1046
1072
|
const args = [];
|
|
@@ -2077,7 +2103,7 @@ var claudeAdapter = {
|
|
|
2077
2103
|
);
|
|
2078
2104
|
}
|
|
2079
2105
|
const mode = permissionMode(thread);
|
|
2080
|
-
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-
|
|
2106
|
+
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-3FDAUNN2.js");
|
|
2081
2107
|
const isOrchestrator = isOrchestratorThread2(thread);
|
|
2082
2108
|
const injectedServers = await buildInjectedMcpServers({
|
|
2083
2109
|
includeSideboard: true,
|
|
@@ -2088,6 +2114,7 @@ var claudeAdapter = {
|
|
|
2088
2114
|
});
|
|
2089
2115
|
const injectedBrightsyNames = injectedServers.filter((s) => s.name === "brightsy" || s.name.startsWith("brightsy_")).map((s) => s.name);
|
|
2090
2116
|
const chromeOn = claudeChromeEnabled();
|
|
2117
|
+
const userMcpEntries = isOrchestrator ? {} : listUserClaudeMcpServerEntries();
|
|
2091
2118
|
let allowedTools;
|
|
2092
2119
|
if (isOrchestrator) {
|
|
2093
2120
|
allowedTools = [
|
|
@@ -2098,7 +2125,7 @@ var claudeAdapter = {
|
|
|
2098
2125
|
} else {
|
|
2099
2126
|
allowedTools = [
|
|
2100
2127
|
...BASE_ALLOWED_TOOLS,
|
|
2101
|
-
...mcpAllowToolsFromNames(
|
|
2128
|
+
...mcpAllowToolsFromNames(Object.keys(userMcpEntries)),
|
|
2102
2129
|
...sideboardWorktreeAllowedTools({
|
|
2103
2130
|
github: true,
|
|
2104
2131
|
linear: isLinearConnected(),
|
|
@@ -2123,7 +2150,7 @@ var claudeAdapter = {
|
|
|
2123
2150
|
if (systemPrompt) {
|
|
2124
2151
|
args.push("--append-system-prompt", systemPrompt);
|
|
2125
2152
|
}
|
|
2126
|
-
const mcpConfigPath = writeMcpServersConfig(injectedServers);
|
|
2153
|
+
const mcpConfigPath = writeMcpServersConfig(injectedServers, userMcpEntries);
|
|
2127
2154
|
if (mcpConfigPath) {
|
|
2128
2155
|
args.push("--mcp-config", mcpConfigPath);
|
|
2129
2156
|
args.push("--strict-mcp-config");
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
allocateTeamName,
|
|
3
|
+
canonicalizeRepoPath,
|
|
3
4
|
ensureGhPreferOrigin,
|
|
4
5
|
resolveGithubRepoSlug,
|
|
5
6
|
resolveRepoRoot,
|
|
@@ -853,6 +854,29 @@ function isLinkedWorktreeOf(path, mainRepo) {
|
|
|
853
854
|
return false;
|
|
854
855
|
}
|
|
855
856
|
}
|
|
857
|
+
function primaryCheckoutFromLinkedWorktree(path) {
|
|
858
|
+
if (!path) return null;
|
|
859
|
+
const git = join3(path, ".git");
|
|
860
|
+
try {
|
|
861
|
+
if (!existsSync2(git) || statSync2(git).isDirectory()) return null;
|
|
862
|
+
const text = readFileSync3(git, "utf8");
|
|
863
|
+
const match = /^\s*gitdir:\s*(.+)$/m.exec(text);
|
|
864
|
+
if (!match) return null;
|
|
865
|
+
const gitdir = match[1].trim().replace(/\/+$/, "");
|
|
866
|
+
const worktrees = gitdir.lastIndexOf("/.git/worktrees/");
|
|
867
|
+
const root = worktrees > 0 ? gitdir.slice(0, worktrees) : gitdir.endsWith("/.git") ? gitdir.slice(0, -5) : null;
|
|
868
|
+
if (!root) return null;
|
|
869
|
+
return canonicalizeRepoPath(root);
|
|
870
|
+
} catch {
|
|
871
|
+
return null;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
function resolveSyncWorkspacePath(path) {
|
|
875
|
+
if (!path || path === "/") return null;
|
|
876
|
+
const primary = primaryCheckoutFromLinkedWorktree(path);
|
|
877
|
+
if (primary) return primary;
|
|
878
|
+
return canonicalizeRepoPath(path);
|
|
879
|
+
}
|
|
856
880
|
async function addWorkspace(repoPath) {
|
|
857
881
|
const root = await resolveRepoRoot(repoPath);
|
|
858
882
|
if (!root || root === "/") throw new Error(`Invalid repo path: ${repoPath}`);
|
|
@@ -881,9 +905,24 @@ async function ensureWorkspace(repoPath) {
|
|
|
881
905
|
function syncWorkspacesFromThreads(repoPaths) {
|
|
882
906
|
const current = readAll();
|
|
883
907
|
const removed = readRemoved();
|
|
884
|
-
const byPath = new Map(
|
|
908
|
+
const byPath = /* @__PURE__ */ new Map();
|
|
885
909
|
let dirty = false;
|
|
886
|
-
for (const
|
|
910
|
+
for (const w of current) {
|
|
911
|
+
const resolved = resolveSyncWorkspacePath(w.path) ?? w.path;
|
|
912
|
+
if (resolved !== w.path) dirty = true;
|
|
913
|
+
if (!resolved || resolved === "/" || isGlobalRepoPath(resolved) || removed.has(resolved)) {
|
|
914
|
+
dirty = true;
|
|
915
|
+
continue;
|
|
916
|
+
}
|
|
917
|
+
if (!byPath.has(resolved)) {
|
|
918
|
+
byPath.set(
|
|
919
|
+
resolved,
|
|
920
|
+
resolved === w.path ? w : { ...w, path: resolved, name: basename2(resolved) }
|
|
921
|
+
);
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
for (const raw of repoPaths) {
|
|
925
|
+
const path = resolveSyncWorkspacePath(raw);
|
|
887
926
|
if (!path || path === "/" || isGlobalRepoPath(path) || byPath.has(path) || removed.has(path)) {
|
|
888
927
|
continue;
|
|
889
928
|
}
|
|
@@ -896,6 +935,13 @@ function syncWorkspacesFromThreads(repoPaths) {
|
|
|
896
935
|
byPath.set(path, ws);
|
|
897
936
|
dirty = true;
|
|
898
937
|
}
|
|
938
|
+
for (const [path] of byPath) {
|
|
939
|
+
const mains = [...byPath.keys()];
|
|
940
|
+
if (mains.some((main) => isLinkedWorktreeOf(path, main))) {
|
|
941
|
+
byPath.delete(path);
|
|
942
|
+
dirty = true;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
899
945
|
const next = [...byPath.values()];
|
|
900
946
|
if (dirty) writeAll(next);
|
|
901
947
|
return next.sort((a, b) => a.name.localeCompare(b.name));
|
|
@@ -916,6 +962,7 @@ export {
|
|
|
916
962
|
persistPendingFileAttachments,
|
|
917
963
|
attachmentsFromWorktreePaths,
|
|
918
964
|
listWorkspaces,
|
|
965
|
+
primaryCheckoutFromLinkedWorktree,
|
|
919
966
|
addWorkspace,
|
|
920
967
|
removeWorkspace,
|
|
921
968
|
ensureWorkspace,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
allocateTeamName,
|
|
5
|
+
canonicalizeRepoPath,
|
|
5
6
|
ensureGhPreferOrigin,
|
|
6
7
|
resolveGithubRepoSlug,
|
|
7
8
|
resolveRepoRoot,
|
|
@@ -808,6 +809,29 @@ function isLinkedWorktreeOf(path, mainRepo) {
|
|
|
808
809
|
return false;
|
|
809
810
|
}
|
|
810
811
|
}
|
|
812
|
+
function primaryCheckoutFromLinkedWorktree(path) {
|
|
813
|
+
if (!path) return null;
|
|
814
|
+
const git = join3(path, ".git");
|
|
815
|
+
try {
|
|
816
|
+
if (!existsSync2(git) || statSync2(git).isDirectory()) return null;
|
|
817
|
+
const text = readFileSync3(git, "utf8");
|
|
818
|
+
const match = /^\s*gitdir:\s*(.+)$/m.exec(text);
|
|
819
|
+
if (!match) return null;
|
|
820
|
+
const gitdir = match[1].trim().replace(/\/+$/, "");
|
|
821
|
+
const worktrees = gitdir.lastIndexOf("/.git/worktrees/");
|
|
822
|
+
const root = worktrees > 0 ? gitdir.slice(0, worktrees) : gitdir.endsWith("/.git") ? gitdir.slice(0, -5) : null;
|
|
823
|
+
if (!root) return null;
|
|
824
|
+
return canonicalizeRepoPath(root);
|
|
825
|
+
} catch {
|
|
826
|
+
return null;
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
function resolveSyncWorkspacePath(path) {
|
|
830
|
+
if (!path || path === "/") return null;
|
|
831
|
+
const primary = primaryCheckoutFromLinkedWorktree(path);
|
|
832
|
+
if (primary) return primary;
|
|
833
|
+
return canonicalizeRepoPath(path);
|
|
834
|
+
}
|
|
811
835
|
async function addWorkspace(repoPath) {
|
|
812
836
|
const root = await resolveRepoRoot(repoPath);
|
|
813
837
|
if (!root || root === "/") throw new Error(`Invalid repo path: ${repoPath}`);
|
|
@@ -836,9 +860,24 @@ async function ensureWorkspace(repoPath) {
|
|
|
836
860
|
function syncWorkspacesFromThreads(repoPaths) {
|
|
837
861
|
const current = readAll();
|
|
838
862
|
const removed = readRemoved();
|
|
839
|
-
const byPath = new Map(
|
|
863
|
+
const byPath = /* @__PURE__ */ new Map();
|
|
840
864
|
let dirty = false;
|
|
841
|
-
for (const
|
|
865
|
+
for (const w of current) {
|
|
866
|
+
const resolved = resolveSyncWorkspacePath(w.path) ?? w.path;
|
|
867
|
+
if (resolved !== w.path) dirty = true;
|
|
868
|
+
if (!resolved || resolved === "/" || isGlobalRepoPath(resolved) || removed.has(resolved)) {
|
|
869
|
+
dirty = true;
|
|
870
|
+
continue;
|
|
871
|
+
}
|
|
872
|
+
if (!byPath.has(resolved)) {
|
|
873
|
+
byPath.set(
|
|
874
|
+
resolved,
|
|
875
|
+
resolved === w.path ? w : { ...w, path: resolved, name: basename2(resolved) }
|
|
876
|
+
);
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
for (const raw of repoPaths) {
|
|
880
|
+
const path = resolveSyncWorkspacePath(raw);
|
|
842
881
|
if (!path || path === "/" || isGlobalRepoPath(path) || byPath.has(path) || removed.has(path)) {
|
|
843
882
|
continue;
|
|
844
883
|
}
|
|
@@ -851,6 +890,13 @@ function syncWorkspacesFromThreads(repoPaths) {
|
|
|
851
890
|
byPath.set(path, ws);
|
|
852
891
|
dirty = true;
|
|
853
892
|
}
|
|
893
|
+
for (const [path] of byPath) {
|
|
894
|
+
const mains = [...byPath.keys()];
|
|
895
|
+
if (mains.some((main) => isLinkedWorktreeOf(path, main))) {
|
|
896
|
+
byPath.delete(path);
|
|
897
|
+
dirty = true;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
854
900
|
const next = [...byPath.values()];
|
|
855
901
|
if (dirty) writeAll(next);
|
|
856
902
|
return next.sort((a, b) => a.name.localeCompare(b.name));
|
|
@@ -862,6 +908,7 @@ export {
|
|
|
862
908
|
persistPendingFileAttachments,
|
|
863
909
|
attachmentsFromWorktreePaths,
|
|
864
910
|
listWorkspaces,
|
|
911
|
+
primaryCheckoutFromLinkedWorktree,
|
|
865
912
|
addWorkspace,
|
|
866
913
|
removeWorkspace,
|
|
867
914
|
ensureWorkspace,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
summarizeTurnStderr,
|
|
43
43
|
toolDescription,
|
|
44
44
|
turnFailChatText
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-IAP5NXQ4.js";
|
|
46
46
|
import {
|
|
47
47
|
SLACK_REPLY_FORMATTING,
|
|
48
48
|
addWorkspace,
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
stageAbsolutePathsAsAttachments,
|
|
66
66
|
stageBuffersAsAttachments,
|
|
67
67
|
syncWorkspacesFromThreads
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-P2EAAM3H.js";
|
|
69
69
|
import {
|
|
70
70
|
addPrStackLayer,
|
|
71
71
|
allocateTeamName,
|
|
@@ -418,7 +418,7 @@ async function continueSourceThread(threadId, prompt) {
|
|
|
418
418
|
await continueOnReply(threadId, prompt);
|
|
419
419
|
return;
|
|
420
420
|
}
|
|
421
|
-
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-
|
|
421
|
+
const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-5VVR7LOU.js");
|
|
422
422
|
await getOrchestrator2().send(threadId, prompt);
|
|
423
423
|
} catch {
|
|
424
424
|
}
|
|
@@ -895,9 +895,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
895
895
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
896
896
|
);
|
|
897
897
|
}
|
|
898
|
-
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-
|
|
898
|
+
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-QPSJEXGR.js");
|
|
899
899
|
if (isGlobalThread2(thread)) {
|
|
900
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-
|
|
900
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-VZ7OSRLD.js");
|
|
901
901
|
ensureGlobalCoordinatorCwd2(
|
|
902
902
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
903
903
|
);
|
|
@@ -4482,7 +4482,7 @@ async function adoptThread(input) {
|
|
|
4482
4482
|
messages: input.messages ?? []
|
|
4483
4483
|
});
|
|
4484
4484
|
writeThread(thread);
|
|
4485
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
4485
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-TDBA64II.js");
|
|
4486
4486
|
await ensureWorkspace2(repoPath);
|
|
4487
4487
|
const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-K7QK4RI5.js");
|
|
4488
4488
|
await ensureWorktreeSideboardIgnored2(input.worktreePath);
|
|
@@ -6957,7 +6957,7 @@ function formatScheduledPrompt(name, prompt) {
|
|
|
6957
6957
|
${prompt}`;
|
|
6958
6958
|
}
|
|
6959
6959
|
async function defaultDeps() {
|
|
6960
|
-
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-
|
|
6960
|
+
const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-5VVR7LOU.js");
|
|
6961
6961
|
const orch = getOrchestrator2();
|
|
6962
6962
|
return {
|
|
6963
6963
|
findThread: (id) => findThreadByRef(id),
|
|
@@ -9231,7 +9231,7 @@ var Orchestrator = class {
|
|
|
9231
9231
|
this.enforceHistoryRetention();
|
|
9232
9232
|
if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
|
|
9233
9233
|
try {
|
|
9234
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
9234
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-TDBA64II.js");
|
|
9235
9235
|
await ensureWorkspace2(thread.repoPath);
|
|
9236
9236
|
} catch {
|
|
9237
9237
|
}
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
orchestratorSessionPoisonedByBuiltins,
|
|
16
16
|
slackCoordinatorSourceRef,
|
|
17
17
|
takenTeamSlugsForOrchestration
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-N2VST3NL.js";
|
|
19
19
|
import "./chunk-KTZESHYH.js";
|
|
20
20
|
import "./chunk-6K64FJDD.js";
|
|
21
21
|
import "./chunk-PO4M4JAJ.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
orchestratorSessionPoisonedByBuiltins,
|
|
18
18
|
slackCoordinatorSourceRef,
|
|
19
19
|
takenTeamSlugsForOrchestration
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-P2EAAM3H.js";
|
|
21
21
|
import "./chunk-NFWPDEN4.js";
|
|
22
22
|
import "./chunk-D6JWYJ4P.js";
|
|
23
23
|
import "./chunk-HY2GFZ5S.js";
|