@sideboard-ai/core 0.1.155 → 0.1.156
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 +6 -1
- package/dist/agents/cursor-runner.js +6 -1
- package/dist/{agents-V24DYZI4.js → agents-2FTZAXO3.js} +4 -2
- package/dist/{agents-YVW75KBO.js → agents-IY4CSPWV.js} +4 -2
- package/dist/{chunk-J2OKVOBM.js → chunk-7EIPEPAH.js} +9 -9
- package/dist/{chunk-2F63IMCL.js → chunk-MSFPM5VK.js} +3 -3
- package/dist/{chunk-46ZTBUVJ.js → chunk-OLE2BLIX.js} +8 -8
- package/dist/{chunk-RNC3GR6L.js → chunk-TI6UMRWK.js} +3 -3
- package/dist/{chunk-4THE3EY7.js → chunk-UA3YZKRX.js} +197 -38
- package/dist/{chunk-QZEZXYVV.js → chunk-XLU7DXHH.js} +260 -32
- package/dist/{coordinator-prompt-7FHKCWXB.js → coordinator-prompt-D2FHU5IZ.js} +1 -1
- package/dist/{coordinator-prompt-KX2FVVYT.js → coordinator-prompt-UZDNIVP7.js} +1 -1
- package/dist/{global-workspace-2BRRKSDN.js → global-workspace-5WZVSWNT.js} +1 -1
- package/dist/{global-workspace-4LHCZ2DC.js → global-workspace-MR75BDBY.js} +1 -1
- package/dist/index.cjs +493 -322
- package/dist/index.d.cts +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +13 -73
- package/dist/mcp/run-stdio.cjs +430 -259
- package/dist/mcp/run-stdio.js +3 -3
- package/dist/{orchestrator-HC7XVGJB.js → orchestrator-G4WKJG5Y.js} +3 -3
- package/dist/{orchestrator-3FWEKDAQ.js → orchestrator-LXO2CDOG.js} +3 -3
- package/dist/{workspaces-MQYNZXUK.js → workspaces-HO4EQNNM.js} +1 -1
- package/dist/{workspaces-5UNDTN4G.js → workspaces-RP32AW6X.js} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isOrchestratorThread
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MSFPM5VK.js";
|
|
4
4
|
import {
|
|
5
5
|
codexUnattendedGitConfigArgs,
|
|
6
6
|
mergeAgentGitAuthEnv,
|
|
@@ -1385,7 +1385,7 @@ function toCodexMcpConfigArgs(servers) {
|
|
|
1385
1385
|
}
|
|
1386
1386
|
return args;
|
|
1387
1387
|
}
|
|
1388
|
-
function toOpencodeMcpConfigContent(servers) {
|
|
1388
|
+
function toOpencodeMcpConfigContent(servers, opts) {
|
|
1389
1389
|
const mcp = {};
|
|
1390
1390
|
for (const s of servers) {
|
|
1391
1391
|
const env = mcpSpawnEnv(s.env);
|
|
@@ -1396,6 +1396,11 @@ function toOpencodeMcpConfigContent(servers) {
|
|
|
1396
1396
|
...env ? { environment: env } : {}
|
|
1397
1397
|
};
|
|
1398
1398
|
}
|
|
1399
|
+
for (const name of opts?.disableNames ?? []) {
|
|
1400
|
+
const key = name.trim();
|
|
1401
|
+
if (!key || mcp[key]?.enabled === true) continue;
|
|
1402
|
+
mcp[key] = { ...mcp[key], enabled: false };
|
|
1403
|
+
}
|
|
1399
1404
|
return JSON.stringify({ mcp });
|
|
1400
1405
|
}
|
|
1401
1406
|
function writeMcpServersConfig(servers) {
|
|
@@ -1614,13 +1619,50 @@ function claudeString(obj, key) {
|
|
|
1614
1619
|
const v = obj[key];
|
|
1615
1620
|
return typeof v === "string" && v.trim() ? v.trim() : void 0;
|
|
1616
1621
|
}
|
|
1622
|
+
function mcpStatusThinkingFromClaudeInit(obj) {
|
|
1623
|
+
const raw = obj.mcp_servers ?? obj.mcpServers;
|
|
1624
|
+
const servers = [];
|
|
1625
|
+
if (Array.isArray(raw)) {
|
|
1626
|
+
for (const item of raw) {
|
|
1627
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) continue;
|
|
1628
|
+
const rec = item;
|
|
1629
|
+
const name = typeof rec.name === "string" && rec.name.trim() || typeof rec.server === "string" && rec.server.trim() || "";
|
|
1630
|
+
const status = typeof rec.status === "string" && rec.status.trim() || typeof rec.state === "string" && rec.state.trim() || "";
|
|
1631
|
+
if (name) servers.push({ name, status: status || "unknown" });
|
|
1632
|
+
}
|
|
1633
|
+
} else if (raw && typeof raw === "object") {
|
|
1634
|
+
for (const [name, value] of Object.entries(raw)) {
|
|
1635
|
+
if (!name.trim()) continue;
|
|
1636
|
+
if (typeof value === "string" && value.trim()) {
|
|
1637
|
+
servers.push({ name, status: value.trim() });
|
|
1638
|
+
continue;
|
|
1639
|
+
}
|
|
1640
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
1641
|
+
const rec = value;
|
|
1642
|
+
const status = typeof rec.status === "string" && rec.status.trim() || typeof rec.state === "string" && rec.state.trim() || "unknown";
|
|
1643
|
+
servers.push({ name, status });
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
const notable = servers.filter((s) => !isCleanMcpConnect(s.status));
|
|
1648
|
+
if (notable.length === 0) return null;
|
|
1649
|
+
return `MCP: ${notable.map((s) => `${s.name} ${s.status}`).join(", ")}`;
|
|
1650
|
+
}
|
|
1651
|
+
function isCleanMcpConnect(status) {
|
|
1652
|
+
return /^(connected|ok|ready|success)$/i.test(status.trim());
|
|
1653
|
+
}
|
|
1617
1654
|
function eventsFromClaudeSystem(obj) {
|
|
1618
1655
|
const subtype = claudeString(obj, "subtype") ?? "";
|
|
1619
1656
|
const parentId = claudeParentToolUseId(obj);
|
|
1620
1657
|
if (subtype === "init") {
|
|
1621
1658
|
if (parentId) return null;
|
|
1622
1659
|
const sid = claudeString(obj, "session_id");
|
|
1623
|
-
|
|
1660
|
+
const mcpNote = mcpStatusThinkingFromClaudeInit(obj);
|
|
1661
|
+
const events = [];
|
|
1662
|
+
if (sid) events.push({ type: "session_id", data: sid });
|
|
1663
|
+
if (mcpNote) events.push({ type: "thinking", data: mcpNote, replace: true });
|
|
1664
|
+
if (events.length === 0) return null;
|
|
1665
|
+
return events.length === 1 ? events[0] : events;
|
|
1624
1666
|
}
|
|
1625
1667
|
if (subtype === "task_started") {
|
|
1626
1668
|
const id = claudeString(obj, "tool_use_id") ?? claudeString(obj, "task_id");
|
|
@@ -1777,7 +1819,7 @@ var claudeAdapter = {
|
|
|
1777
1819
|
);
|
|
1778
1820
|
}
|
|
1779
1821
|
const mode = permissionMode(thread);
|
|
1780
|
-
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-
|
|
1822
|
+
const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-5WZVSWNT.js");
|
|
1781
1823
|
const isOrchestrator = isOrchestratorThread2(thread);
|
|
1782
1824
|
const injectedServers = await buildInjectedMcpServers({
|
|
1783
1825
|
includeSideboard: true,
|
|
@@ -1820,6 +1862,9 @@ var claudeAdapter = {
|
|
|
1820
1862
|
const mcpConfigPath = writeMcpServersConfig(injectedServers);
|
|
1821
1863
|
if (mcpConfigPath) {
|
|
1822
1864
|
args.push("--mcp-config", mcpConfigPath);
|
|
1865
|
+
if (isOrchestrator) {
|
|
1866
|
+
args.push("--strict-mcp-config");
|
|
1867
|
+
}
|
|
1823
1868
|
}
|
|
1824
1869
|
if (chromeOn) {
|
|
1825
1870
|
args.push("--chrome");
|
|
@@ -1849,7 +1894,10 @@ var claudeAdapter = {
|
|
|
1849
1894
|
// abandoned at Claude Code’s 10-minute default.
|
|
1850
1895
|
env: {
|
|
1851
1896
|
CLAUDE_CODE_FORWARD_SUBAGENT_TEXT: "1",
|
|
1852
|
-
CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS: process.env.CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS ?? String(CLAUDE_PRINT_BG_WAIT_CEILING_MS)
|
|
1897
|
+
CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS: process.env.CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS ?? String(CLAUDE_PRINT_BG_WAIT_CEILING_MS),
|
|
1898
|
+
// `--strict-mcp-config` still fetches claude.ai connectors on some CLI
|
|
1899
|
+
// builds (anthropics/claude-code#60252). Coordinators do not need them.
|
|
1900
|
+
...isOrchestrator ? { ENABLE_CLAUDEAI_MCP_SERVERS: "false" } : {}
|
|
1853
1901
|
}
|
|
1854
1902
|
};
|
|
1855
1903
|
},
|
|
@@ -1997,9 +2045,170 @@ function parseIssuesJson(raw) {
|
|
|
1997
2045
|
}
|
|
1998
2046
|
|
|
1999
2047
|
// src/agents/codex.ts
|
|
2000
|
-
import { existsSync as
|
|
2048
|
+
import { existsSync as existsSync6, readFileSync as readFileSync3, statSync } from "fs";
|
|
2049
|
+
import { homedir as homedir3 } from "os";
|
|
2050
|
+
import { join as join4 } from "path";
|
|
2051
|
+
|
|
2052
|
+
// src/agents/orch-mcp-isolation.ts
|
|
2053
|
+
import { existsSync as existsSync5, readFileSync as readFileSync2 } from "fs";
|
|
2054
|
+
import { homedir as homedir2 } from "os";
|
|
2055
|
+
import { join as join3 } from "path";
|
|
2056
|
+
import { parse as parseToml } from "smol-toml";
|
|
2057
|
+
|
|
2058
|
+
// src/agents/user-mcp-config.ts
|
|
2059
|
+
import { existsSync as existsSync4, mkdirSync, readFileSync, writeFileSync as writeFileSync2 } from "fs";
|
|
2001
2060
|
import { homedir } from "os";
|
|
2002
|
-
import { join as join2 } from "path";
|
|
2061
|
+
import { dirname as dirname2, join as join2 } from "path";
|
|
2062
|
+
function userCursorMcpConfigPath() {
|
|
2063
|
+
return join2(homedir(), ".cursor", "mcp.json");
|
|
2064
|
+
}
|
|
2065
|
+
function userClaudeMcpConfigPath() {
|
|
2066
|
+
return join2(homedir(), ".claude.json");
|
|
2067
|
+
}
|
|
2068
|
+
function asObject(value) {
|
|
2069
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
2070
|
+
return { ...value };
|
|
2071
|
+
}
|
|
2072
|
+
function stripElectronSpawnEnv(env) {
|
|
2073
|
+
if (!env) return void 0;
|
|
2074
|
+
const next = { ...env };
|
|
2075
|
+
delete next.ELECTRON_RUN_AS_NODE;
|
|
2076
|
+
delete next.ELECTRON_RUN_AS_NODE;
|
|
2077
|
+
return Object.keys(next).length > 0 ? next : void 0;
|
|
2078
|
+
}
|
|
2079
|
+
function mergeSideboardIntoMcpServersJson(existing, sideboard) {
|
|
2080
|
+
const root = asObject(existing);
|
|
2081
|
+
const servers = asObject(root.mcpServers);
|
|
2082
|
+
const env = stripElectronSpawnEnv(sideboard.env);
|
|
2083
|
+
servers.sideboard = {
|
|
2084
|
+
type: "stdio",
|
|
2085
|
+
command: sideboard.command,
|
|
2086
|
+
...sideboard.args && sideboard.args.length > 0 ? { args: sideboard.args } : {},
|
|
2087
|
+
...env ? { env } : {}
|
|
2088
|
+
};
|
|
2089
|
+
return { ...root, mcpServers: servers };
|
|
2090
|
+
}
|
|
2091
|
+
function writeMergedMcpServersJson(configPath, sideboard) {
|
|
2092
|
+
let existing = {};
|
|
2093
|
+
if (existsSync4(configPath)) {
|
|
2094
|
+
try {
|
|
2095
|
+
existing = JSON.parse(readFileSync(configPath, "utf8"));
|
|
2096
|
+
} catch {
|
|
2097
|
+
existing = {};
|
|
2098
|
+
}
|
|
2099
|
+
}
|
|
2100
|
+
const next = mergeSideboardIntoMcpServersJson(existing, sideboard);
|
|
2101
|
+
mkdirSync(dirname2(configPath), { recursive: true });
|
|
2102
|
+
writeFileSync2(configPath, `${JSON.stringify(next, null, 2)}
|
|
2103
|
+
`);
|
|
2104
|
+
}
|
|
2105
|
+
function launchFromResolved(server) {
|
|
2106
|
+
return {
|
|
2107
|
+
command: server.command,
|
|
2108
|
+
args: server.args,
|
|
2109
|
+
env: {
|
|
2110
|
+
...server.env ?? {},
|
|
2111
|
+
SIDEBOARD_APP_DATA: appDataDir()
|
|
2112
|
+
}
|
|
2113
|
+
};
|
|
2114
|
+
}
|
|
2115
|
+
async function registerPackagedUserMcpClients() {
|
|
2116
|
+
const launch = launchFromResolved(await resolveSideboardMcpServer());
|
|
2117
|
+
const cursor = userCursorMcpConfigPath();
|
|
2118
|
+
writeMergedMcpServersJson(cursor, launch);
|
|
2119
|
+
const claude = userClaudeMcpConfigPath();
|
|
2120
|
+
if (existsSync4(claude)) {
|
|
2121
|
+
writeMergedMcpServersJson(claude, launch);
|
|
2122
|
+
return { cursor, claude };
|
|
2123
|
+
}
|
|
2124
|
+
return { cursor };
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
// src/agents/orch-mcp-isolation.ts
|
|
2128
|
+
function isInjectedOrchMcpName(name) {
|
|
2129
|
+
const n = name.trim().toLowerCase();
|
|
2130
|
+
return n === "sideboard" || n === "brightsy" || n.startsWith("brightsy_");
|
|
2131
|
+
}
|
|
2132
|
+
function asObject2(value) {
|
|
2133
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return {};
|
|
2134
|
+
return value;
|
|
2135
|
+
}
|
|
2136
|
+
function listMcpNamesFromJsonMap(raw, key) {
|
|
2137
|
+
return Object.keys(asObject2(asObject2(raw)[key])).filter((n) => n.trim());
|
|
2138
|
+
}
|
|
2139
|
+
function listMcpNamesFromCodexToml(text) {
|
|
2140
|
+
try {
|
|
2141
|
+
const parsed = parseToml(text);
|
|
2142
|
+
return Object.keys(asObject2(parsed.mcp_servers)).filter((n) => n.trim());
|
|
2143
|
+
} catch {
|
|
2144
|
+
return [];
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
function readJsonObject(path) {
|
|
2148
|
+
try {
|
|
2149
|
+
return JSON.parse(readFileSync2(path, "utf8"));
|
|
2150
|
+
} catch {
|
|
2151
|
+
return {};
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
function readText(path) {
|
|
2155
|
+
try {
|
|
2156
|
+
return readFileSync2(path, "utf8");
|
|
2157
|
+
} catch {
|
|
2158
|
+
return "";
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
function userCodexConfigPaths(home = homedir2()) {
|
|
2162
|
+
return [join3(home, ".codex", "config.toml"), join3(home, ".config", "codex", "config.toml")];
|
|
2163
|
+
}
|
|
2164
|
+
function userOpencodeConfigPaths(home = homedir2()) {
|
|
2165
|
+
return [
|
|
2166
|
+
join3(home, ".config", "opencode", "opencode.json"),
|
|
2167
|
+
join3(home, ".config", "opencode", "opencode.jsonc")
|
|
2168
|
+
];
|
|
2169
|
+
}
|
|
2170
|
+
function userMcpNamesToDisable(opts) {
|
|
2171
|
+
const keep = new Set(
|
|
2172
|
+
[...opts.injectedNames ?? []].map((n) => n.trim().toLowerCase()).filter(Boolean)
|
|
2173
|
+
);
|
|
2174
|
+
const out = [];
|
|
2175
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2176
|
+
for (const raw of opts.names) {
|
|
2177
|
+
const name = raw.trim();
|
|
2178
|
+
if (!name) continue;
|
|
2179
|
+
const key = name.toLowerCase();
|
|
2180
|
+
if (seen.has(key) || keep.has(key) || isInjectedOrchMcpName(name)) continue;
|
|
2181
|
+
seen.add(key);
|
|
2182
|
+
out.push(name);
|
|
2183
|
+
}
|
|
2184
|
+
return out;
|
|
2185
|
+
}
|
|
2186
|
+
function listUserCodexMcpNames(home = homedir2()) {
|
|
2187
|
+
const names = [];
|
|
2188
|
+
for (const path of userCodexConfigPaths(home)) {
|
|
2189
|
+
if (!existsSync5(path)) continue;
|
|
2190
|
+
names.push(...listMcpNamesFromCodexToml(readText(path)));
|
|
2191
|
+
}
|
|
2192
|
+
return names;
|
|
2193
|
+
}
|
|
2194
|
+
function listUserOpencodeMcpNames(home = homedir2()) {
|
|
2195
|
+
const names = [];
|
|
2196
|
+
for (const path of userOpencodeConfigPaths(home)) {
|
|
2197
|
+
if (!existsSync5(path)) continue;
|
|
2198
|
+
names.push(...listMcpNamesFromJsonMap(readJsonObject(path), "mcp"));
|
|
2199
|
+
}
|
|
2200
|
+
return names;
|
|
2201
|
+
}
|
|
2202
|
+
function toCodexDisableUserMcpArgs(names) {
|
|
2203
|
+
const args = [];
|
|
2204
|
+
for (const name of names) {
|
|
2205
|
+
if (!/^[A-Za-z0-9_-]+$/.test(name)) continue;
|
|
2206
|
+
args.push("-c", `mcp_servers.${name}.enabled=false`);
|
|
2207
|
+
}
|
|
2208
|
+
return args;
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
// src/agents/codex.ts
|
|
2003
2212
|
var CODEX_PROMPT_ARG_MAX = 2e5;
|
|
2004
2213
|
var FALLBACK_CODEX_MODELS = [
|
|
2005
2214
|
{ id: "gpt-5.6-sol", displayName: "GPT-5.6 Sol" },
|
|
@@ -2019,7 +2228,7 @@ async function listCodexModels() {
|
|
|
2019
2228
|
if (codex === "codex") {
|
|
2020
2229
|
const which = await run("which", ["codex"], { reject: false });
|
|
2021
2230
|
if (which.exitCode !== 0) return FALLBACK_CODEX_MODELS;
|
|
2022
|
-
} else if (!
|
|
2231
|
+
} else if (!existsSync6(codex)) {
|
|
2023
2232
|
return FALLBACK_CODEX_MODELS;
|
|
2024
2233
|
}
|
|
2025
2234
|
const listed = await run(codex, ["debug", "models"], { reject: false });
|
|
@@ -2054,12 +2263,12 @@ function usageFromCodex(usage) {
|
|
|
2054
2263
|
}
|
|
2055
2264
|
function codexConfigHasNetworkAccess() {
|
|
2056
2265
|
const candidates = [
|
|
2057
|
-
|
|
2058
|
-
|
|
2266
|
+
join4(homedir3(), ".codex", "config.toml"),
|
|
2267
|
+
join4(homedir3(), ".config", "codex", "config.toml")
|
|
2059
2268
|
];
|
|
2060
2269
|
for (const path of candidates) {
|
|
2061
|
-
if (!
|
|
2062
|
-
const text =
|
|
2270
|
+
if (!existsSync6(path)) continue;
|
|
2271
|
+
const text = readFileSync3(path, "utf8");
|
|
2063
2272
|
if (/network_access\s*=\s*true/.test(text)) return true;
|
|
2064
2273
|
}
|
|
2065
2274
|
return false;
|
|
@@ -2091,8 +2300,8 @@ function asRecord2(value) {
|
|
|
2091
2300
|
return void 0;
|
|
2092
2301
|
}
|
|
2093
2302
|
function codexLooksAuthenticated() {
|
|
2094
|
-
const authPath =
|
|
2095
|
-
if (!
|
|
2303
|
+
const authPath = join4(homedir3(), ".codex", "auth.json");
|
|
2304
|
+
if (!existsSync6(authPath)) return false;
|
|
2096
2305
|
try {
|
|
2097
2306
|
return statSync(authPath).size > 2;
|
|
2098
2307
|
} catch {
|
|
@@ -2104,7 +2313,7 @@ var codexAdapter = {
|
|
|
2104
2313
|
async detect() {
|
|
2105
2314
|
const codex = resolveAgentExecutable("codex");
|
|
2106
2315
|
if (codex !== "codex") {
|
|
2107
|
-
if (!
|
|
2316
|
+
if (!existsSync6(codex)) {
|
|
2108
2317
|
return {
|
|
2109
2318
|
agent: "codex",
|
|
2110
2319
|
installed: false,
|
|
@@ -2164,7 +2373,15 @@ var codexAdapter = {
|
|
|
2164
2373
|
}),
|
|
2165
2374
|
orchestratorThreadId: isOrchestrator ? thread.id : null
|
|
2166
2375
|
});
|
|
2167
|
-
const mcpOverrides =
|
|
2376
|
+
const mcpOverrides = [
|
|
2377
|
+
...toCodexMcpConfigArgs(injected),
|
|
2378
|
+
...isOrchestrator ? toCodexDisableUserMcpArgs(
|
|
2379
|
+
userMcpNamesToDisable({
|
|
2380
|
+
injectedNames: injected.map((s) => s.name),
|
|
2381
|
+
names: listUserCodexMcpNames()
|
|
2382
|
+
})
|
|
2383
|
+
) : []
|
|
2384
|
+
];
|
|
2168
2385
|
const execOpts = [
|
|
2169
2386
|
// Global orchestration cwd is not a git repo; without this Codex ≥0.147
|
|
2170
2387
|
// refuses to start ("Not inside a trusted directory").
|
|
@@ -2364,9 +2581,9 @@ var codexAdapter = {
|
|
|
2364
2581
|
};
|
|
2365
2582
|
|
|
2366
2583
|
// src/agents/cursor.ts
|
|
2367
|
-
import { existsSync as
|
|
2584
|
+
import { existsSync as existsSync7 } from "fs";
|
|
2368
2585
|
import { createRequire as createRequire2 } from "module";
|
|
2369
|
-
import { dirname as
|
|
2586
|
+
import { dirname as dirname3, join as join5 } from "path";
|
|
2370
2587
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
2371
2588
|
import { Cursor } from "@cursor/sdk";
|
|
2372
2589
|
var FALLBACK_CURSOR_MODELS = [
|
|
@@ -2414,11 +2631,11 @@ function entryDir() {
|
|
|
2414
2631
|
const cjsDir = typeof __dirname !== "undefined" ? __dirname : "";
|
|
2415
2632
|
if (cjsDir) return cjsDir;
|
|
2416
2633
|
try {
|
|
2417
|
-
return
|
|
2634
|
+
return dirname3(fileURLToPath2(import.meta.url));
|
|
2418
2635
|
} catch {
|
|
2419
2636
|
try {
|
|
2420
2637
|
const req = createRequire2(process.cwd() + "/");
|
|
2421
|
-
return
|
|
2638
|
+
return dirname3(req.resolve("@sideboard-ai/core"));
|
|
2422
2639
|
} catch {
|
|
2423
2640
|
return process.cwd();
|
|
2424
2641
|
}
|
|
@@ -2429,17 +2646,17 @@ function cursorRunnerPath() {
|
|
|
2429
2646
|
if (packaged) return packaged;
|
|
2430
2647
|
const root = entryDir();
|
|
2431
2648
|
const candidates = [
|
|
2432
|
-
|
|
2433
|
-
|
|
2649
|
+
join5(root, "agents", "cursor-runner.js"),
|
|
2650
|
+
join5(root, "agents", "cursor-runner.cjs"),
|
|
2434
2651
|
// If somehow resolved from package root instead of dist/
|
|
2435
|
-
|
|
2436
|
-
|
|
2652
|
+
join5(root, "dist", "agents", "cursor-runner.js"),
|
|
2653
|
+
join5(root, "dist", "agents", "cursor-runner.cjs"),
|
|
2437
2654
|
// Source tree (dev): packages/core/src/agents/cursor-runner.ts
|
|
2438
|
-
|
|
2439
|
-
|
|
2655
|
+
join5(root, "cursor-runner.ts"),
|
|
2656
|
+
join5(root, "src", "agents", "cursor-runner.ts")
|
|
2440
2657
|
];
|
|
2441
2658
|
for (const candidate of candidates) {
|
|
2442
|
-
if (
|
|
2659
|
+
if (existsSync7(candidate)) return candidate;
|
|
2443
2660
|
}
|
|
2444
2661
|
return candidates[0];
|
|
2445
2662
|
}
|
|
@@ -2488,6 +2705,7 @@ var cursorAdapter = {
|
|
|
2488
2705
|
fast: thread.fast,
|
|
2489
2706
|
planMode: thread.planMode,
|
|
2490
2707
|
apiKey,
|
|
2708
|
+
...isOrchestrator ? { isolateAmbientMcp: true } : {},
|
|
2491
2709
|
...Object.keys(mcpServers).length > 0 ? { mcpServers } : {}
|
|
2492
2710
|
};
|
|
2493
2711
|
const runner = cursorRunnerPath();
|
|
@@ -2526,7 +2744,7 @@ var cursorAdapter = {
|
|
|
2526
2744
|
};
|
|
2527
2745
|
|
|
2528
2746
|
// src/agents/opencode.ts
|
|
2529
|
-
import { existsSync as
|
|
2747
|
+
import { existsSync as existsSync8 } from "fs";
|
|
2530
2748
|
var FALLBACK_OPENCODE_MODELS = [
|
|
2531
2749
|
{ id: "opencode/big-pickle", displayName: "opencode \xB7 big-pickle" },
|
|
2532
2750
|
{
|
|
@@ -2585,7 +2803,7 @@ async function listOpencodeModels() {
|
|
|
2585
2803
|
if (opencode === "opencode") {
|
|
2586
2804
|
const which = await run("which", ["opencode"], { reject: false });
|
|
2587
2805
|
if (which.exitCode !== 0) return FALLBACK_OPENCODE_MODELS;
|
|
2588
|
-
} else if (!
|
|
2806
|
+
} else if (!existsSync8(opencode)) {
|
|
2589
2807
|
return FALLBACK_OPENCODE_MODELS;
|
|
2590
2808
|
}
|
|
2591
2809
|
const listed = await run(opencode, ["models"], { reject: false });
|
|
@@ -2620,7 +2838,7 @@ var opencodeAdapter = {
|
|
|
2620
2838
|
async detect() {
|
|
2621
2839
|
const opencode = resolveAgentExecutable("opencode");
|
|
2622
2840
|
if (opencode !== "opencode") {
|
|
2623
|
-
if (!
|
|
2841
|
+
if (!existsSync8(opencode)) {
|
|
2624
2842
|
return {
|
|
2625
2843
|
agent: "opencode",
|
|
2626
2844
|
installed: false,
|
|
@@ -2682,7 +2900,11 @@ var opencodeAdapter = {
|
|
|
2682
2900
|
}),
|
|
2683
2901
|
orchestratorThreadId: isOrchestrator ? thread.id : null
|
|
2684
2902
|
});
|
|
2685
|
-
const
|
|
2903
|
+
const disableNames = isOrchestrator ? userMcpNamesToDisable({
|
|
2904
|
+
injectedNames: injected.map((s) => s.name),
|
|
2905
|
+
names: listUserOpencodeMcpNames()
|
|
2906
|
+
}) : [];
|
|
2907
|
+
const mcpContent = injected.length > 0 || disableNames.length > 0 ? toOpencodeMcpConfigContent(injected, { disableNames }) : null;
|
|
2686
2908
|
return {
|
|
2687
2909
|
file: resolveAgentExecutable("opencode"),
|
|
2688
2910
|
args,
|
|
@@ -3374,11 +3596,17 @@ export {
|
|
|
3374
3596
|
threadRequestsBrightsyMcp,
|
|
3375
3597
|
shouldInjectBrightsyMcp,
|
|
3376
3598
|
brightsyMcpAllowedTools,
|
|
3377
|
-
resolveSideboardMcpServer,
|
|
3378
3599
|
writeInjectedMcpConfig,
|
|
3379
3600
|
PLAN_MODE_INSTRUCTION,
|
|
3380
3601
|
permissionMode,
|
|
3602
|
+
mcpStatusThinkingFromClaudeInit,
|
|
3381
3603
|
claudeAdapter,
|
|
3604
|
+
userCursorMcpConfigPath,
|
|
3605
|
+
userClaudeMcpConfigPath,
|
|
3606
|
+
mergeSideboardIntoMcpServersJson,
|
|
3607
|
+
registerPackagedUserMcpClients,
|
|
3608
|
+
isInjectedOrchMcpName,
|
|
3609
|
+
userMcpNamesToDisable,
|
|
3382
3610
|
listCodexModels,
|
|
3383
3611
|
codexAdapter,
|
|
3384
3612
|
isCursorAutoModel,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
orchestratorSessionPoisonedByBuiltins,
|
|
16
16
|
slackCoordinatorSourceRef,
|
|
17
17
|
takenTeamSlugsForOrchestration
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-MSFPM5VK.js";
|
|
19
19
|
import "./chunk-LQMFCS54.js";
|
|
20
20
|
import "./chunk-JRH62XC4.js";
|
|
21
21
|
import "./chunk-3BWVOUQG.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
orchestratorSessionPoisonedByBuiltins,
|
|
18
18
|
slackCoordinatorSourceRef,
|
|
19
19
|
takenTeamSlugsForOrchestration
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-TI6UMRWK.js";
|
|
21
21
|
import "./chunk-CJQLPPEJ.js";
|
|
22
22
|
import "./chunk-NVXVEGGM.js";
|
|
23
23
|
import "./chunk-LZQULFIT.js";
|