@sideboard-ai/core 0.1.87 → 0.1.88
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.js +1 -1
- package/dist/{agents-W5446HSV.js → agents-LMUFTGKF.js} +5 -5
- package/dist/{agents-V6PVSQYH.js → agents-ODBP7J6E.js} +6 -6
- package/dist/{app-settings-HFINR3XG.js → app-settings-BRF7VKTQ.js} +2 -2
- package/dist/{app-settings-F36ISTCF.js → app-settings-ZXPAB3QN.js} +1 -1
- package/dist/{chunk-HBXQQ5TO.js → chunk-6EZRSCIT.js} +2 -2
- package/dist/{chunk-TC2KY5G7.js → chunk-6LFV4VFI.js} +14 -1
- package/dist/{chunk-L63LLCTX.js → chunk-7D27DD2X.js} +1 -1
- package/dist/{chunk-4PTN2LED.js → chunk-B2KIO2SD.js} +3 -3
- package/dist/{chunk-XY6XXMAK.js → chunk-FT2SQOL4.js} +1 -1
- package/dist/{chunk-QWNROSRB.js → chunk-JE75QW2I.js} +56 -22
- package/dist/{chunk-3MA6JH6G.js → chunk-OB6IRIFV.js} +2 -2
- package/dist/{chunk-U4GZKLIV.js → chunk-RJLBSYUO.js} +57 -23
- package/dist/{chunk-5KLC2MWZ.js → chunk-TLPJHLLM.js} +14 -1
- package/dist/{chunk-UVNXLTFB.js → chunk-UHTNJKZX.js} +3 -3
- package/dist/{chunk-A7LONVNO.js → chunk-VZ2L4AEJ.js} +2 -2
- package/dist/{chunk-R2EOZNQI.js → chunk-WANQFU3S.js} +2 -2
- package/dist/{chunk-CY45C3GA.js → chunk-ZXYWWSHZ.js} +1 -1
- package/dist/{coordinator-prompt-PYRAXZN3.js → coordinator-prompt-CI5SHONJ.js} +3 -3
- package/dist/{coordinator-prompt-EC3KQLN3.js → coordinator-prompt-UK5LYFN5.js} +4 -4
- package/dist/{global-workspace-T5IAJF4R.js → global-workspace-2YZ2V4I5.js} +4 -4
- package/dist/{global-workspace-ICWOWUW6.js → global-workspace-JQQLPJM5.js} +5 -5
- package/dist/index.cjs +61 -16
- package/dist/index.js +21 -21
- package/dist/mcp/run-stdio.cjs +61 -16
- package/dist/mcp/run-stdio.js +19 -19
- package/dist/{workspaces-J4ULXOUH.js → workspaces-FDO5L4NI.js} +5 -5
- package/dist/{workspaces-AJCAFW64.js → workspaces-YWCC3WV4.js} +6 -6
- package/dist/{worktree-4Z2VSHAQ.js → worktree-4555QBQ7.js} +2 -2
- package/dist/{worktree-H57CCHWO.js → worktree-7YNSJ224.js} +3 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -547,6 +547,18 @@ function wrapElectronAsNodeLaunch(file, args) {
|
|
|
547
547
|
function isStrippedElectronLaunch(command, args) {
|
|
548
548
|
return command === "/bin/sh" && Boolean(args?.[1]?.includes("ELECTRON_RUN_AS_NODE") && args[1].includes("unset"));
|
|
549
549
|
}
|
|
550
|
+
function isElectronLikeCommand(command) {
|
|
551
|
+
const name = command.trim();
|
|
552
|
+
if (!name) return false;
|
|
553
|
+
if (process.versions.electron && name === process.execPath) return true;
|
|
554
|
+
return /(?:^|[/\\])Electron(?:\.exe)?$/i.test(name) || /Sideboard\.app[/\\]/i.test(name) || /Electron\.app[/\\]/i.test(name);
|
|
555
|
+
}
|
|
556
|
+
function unwrapStrippedElectronLaunch(command, args) {
|
|
557
|
+
if (!isStrippedElectronLaunch(command, args) || !args || args.length < 4) {
|
|
558
|
+
return null;
|
|
559
|
+
}
|
|
560
|
+
return { file: args[3], args: args.slice(4) };
|
|
561
|
+
}
|
|
550
562
|
var NESTED_ELECTRON_ENV_PREFIXES, STRIP_NESTED_ELECTRON_THEN_EXEC;
|
|
551
563
|
var init_nested_electron_env = __esm({
|
|
552
564
|
"src/hook/nested-electron-env.ts"() {
|
|
@@ -6657,22 +6669,52 @@ async function buildInjectedMcpServers(opts) {
|
|
|
6657
6669
|
}
|
|
6658
6670
|
return servers;
|
|
6659
6671
|
}
|
|
6672
|
+
function shSingleQuote(value) {
|
|
6673
|
+
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
6674
|
+
}
|
|
6675
|
+
function cursorSafeMcpLaunch(command, args) {
|
|
6676
|
+
if (process.platform === "win32") {
|
|
6677
|
+
return args && args.length > 0 ? { command, args } : { command };
|
|
6678
|
+
}
|
|
6679
|
+
const unwrapped = unwrapStrippedElectronLaunch(command, args);
|
|
6680
|
+
const file = unwrapped?.file ?? command;
|
|
6681
|
+
const fileArgs = unwrapped?.args ?? args ?? [];
|
|
6682
|
+
if (!isElectronLikeCommand(file)) {
|
|
6683
|
+
return fileArgs.length > 0 ? { command: file, args: fileArgs } : { command: file };
|
|
6684
|
+
}
|
|
6685
|
+
const dir = (0, import_node_path16.join)(appDataDir(), "mcp-launch");
|
|
6686
|
+
(0, import_node_fs17.mkdirSync)(dir, { recursive: true });
|
|
6687
|
+
const wrap = (0, import_node_path16.join)(dir, "cursor-electron-as-node.sh");
|
|
6688
|
+
const execLine = [file, ...fileArgs].map(shSingleQuote).join(" ");
|
|
6689
|
+
(0, import_node_fs17.writeFileSync)(
|
|
6690
|
+
wrap,
|
|
6691
|
+
[
|
|
6692
|
+
"#!/bin/sh",
|
|
6693
|
+
"vars=`printenv | awk -F= '/^(ELECTRON_|CHROME_)/{print $1}'`",
|
|
6694
|
+
'[ -n "$vars" ] && unset $vars',
|
|
6695
|
+
"export ELECTRON_RUN_AS_NODE=1",
|
|
6696
|
+
`exec ${execLine} "$@"`,
|
|
6697
|
+
""
|
|
6698
|
+
].join("\n"),
|
|
6699
|
+
{ mode: 493 }
|
|
6700
|
+
);
|
|
6701
|
+
return { command: wrap };
|
|
6702
|
+
}
|
|
6703
|
+
function mcpSpawnEnv(env) {
|
|
6704
|
+
if (!env) return void 0;
|
|
6705
|
+
const out = { ...env };
|
|
6706
|
+
delete out.ELECTRON_RUN_AS_NODE;
|
|
6707
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
6708
|
+
}
|
|
6660
6709
|
function toCursorMcpServers(servers) {
|
|
6661
6710
|
const out = {};
|
|
6662
6711
|
for (const s of servers) {
|
|
6663
|
-
const env = s.env
|
|
6664
|
-
|
|
6665
|
-
let command = s.command;
|
|
6666
|
-
let args = s.args;
|
|
6667
|
-
if (process.platform !== "win32" && !isStrippedElectronLaunch(command, args)) {
|
|
6668
|
-
const wrapped = wrapElectronAsNodeLaunch(command, args ?? []);
|
|
6669
|
-
command = wrapped.file;
|
|
6670
|
-
args = wrapped.args;
|
|
6671
|
-
}
|
|
6712
|
+
const env = mcpSpawnEnv(s.env);
|
|
6713
|
+
const launch = cursorSafeMcpLaunch(s.command, s.args);
|
|
6672
6714
|
out[s.name] = {
|
|
6673
|
-
command,
|
|
6674
|
-
...args && args.length > 0 ? { args } : {},
|
|
6675
|
-
...env
|
|
6715
|
+
command: launch.command,
|
|
6716
|
+
...launch.args && launch.args.length > 0 ? { args: launch.args } : {},
|
|
6717
|
+
...env ? { env } : {}
|
|
6676
6718
|
};
|
|
6677
6719
|
}
|
|
6678
6720
|
return out;
|
|
@@ -6685,8 +6727,9 @@ function toCodexMcpConfigArgs(servers) {
|
|
|
6685
6727
|
if (s.args?.length) {
|
|
6686
6728
|
args.push("-c", `${prefix}.args=${JSON.stringify(s.args)}`);
|
|
6687
6729
|
}
|
|
6688
|
-
|
|
6689
|
-
|
|
6730
|
+
const env = mcpSpawnEnv(s.env);
|
|
6731
|
+
if (env) {
|
|
6732
|
+
for (const [key, value] of Object.entries(env)) {
|
|
6690
6733
|
args.push("-c", `${prefix}.env.${key}=${JSON.stringify(value)}`);
|
|
6691
6734
|
}
|
|
6692
6735
|
}
|
|
@@ -6699,11 +6742,12 @@ function toCodexMcpConfigArgs(servers) {
|
|
|
6699
6742
|
function toOpencodeMcpConfigContent(servers) {
|
|
6700
6743
|
const mcp = {};
|
|
6701
6744
|
for (const s of servers) {
|
|
6745
|
+
const env = mcpSpawnEnv(s.env);
|
|
6702
6746
|
mcp[s.name] = {
|
|
6703
6747
|
type: "local",
|
|
6704
6748
|
command: [s.command, ...s.args ?? []],
|
|
6705
6749
|
enabled: true,
|
|
6706
|
-
...
|
|
6750
|
+
...env ? { environment: env } : {}
|
|
6707
6751
|
};
|
|
6708
6752
|
}
|
|
6709
6753
|
return JSON.stringify({ mcp });
|
|
@@ -6712,10 +6756,11 @@ function writeMcpServersConfig(servers) {
|
|
|
6712
6756
|
if (servers.length === 0) return null;
|
|
6713
6757
|
const mcpServers = {};
|
|
6714
6758
|
for (const s of servers) {
|
|
6759
|
+
const env = mcpSpawnEnv(s.env);
|
|
6715
6760
|
mcpServers[s.name] = {
|
|
6716
6761
|
command: s.command,
|
|
6717
6762
|
...s.args ? { args: s.args } : {},
|
|
6718
|
-
...
|
|
6763
|
+
...env ? { env } : {}
|
|
6719
6764
|
};
|
|
6720
6765
|
}
|
|
6721
6766
|
const dir = (0, import_node_fs17.mkdtempSync)((0, import_node_path16.join)((0, import_node_os6.tmpdir)(), "sideboard-mcp-"));
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
listWorkspaces,
|
|
5
5
|
removeWorkspace,
|
|
6
6
|
syncWorkspacesFromThreads
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6EZRSCIT.js";
|
|
8
8
|
import {
|
|
9
9
|
BRIGHTSY_MCP_ALLOWED_TOOLS,
|
|
10
10
|
CLAUDE_MODEL_CATALOG,
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
threadRequestsBrightsyMcp,
|
|
65
65
|
totalTokens,
|
|
66
66
|
writeInjectedMcpConfig
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-RJLBSYUO.js";
|
|
68
68
|
import {
|
|
69
69
|
CLOUD_COORDINATOR_BUSY_REPLY,
|
|
70
70
|
CLOUD_COORDINATOR_STOPPED_REPLY,
|
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
parseForceStopMessage,
|
|
92
92
|
slackCoordinatorSourceRef,
|
|
93
93
|
takenTeamSlugsForOrchestration
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-B2KIO2SD.js";
|
|
95
95
|
import {
|
|
96
96
|
COORDINATOR_TOOL_PLAYBOOK,
|
|
97
97
|
SLACK_REPLY_FORMATTING,
|
|
@@ -100,7 +100,7 @@ import {
|
|
|
100
100
|
enrichWorkspacesWithGithub,
|
|
101
101
|
ensureGlobalCoordinatorCwd,
|
|
102
102
|
formatWorkspaceInventory
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-VZ2L4AEJ.js";
|
|
104
104
|
import {
|
|
105
105
|
brightsyConfigPath,
|
|
106
106
|
brightsyMcpServerName,
|
|
@@ -214,7 +214,7 @@ import {
|
|
|
214
214
|
worktreeDisplayLabel,
|
|
215
215
|
worktreeDisplayLabelForGroup,
|
|
216
216
|
worktreeNameFromPath
|
|
217
|
-
} from "./chunk-
|
|
217
|
+
} from "./chunk-7D27DD2X.js";
|
|
218
218
|
import {
|
|
219
219
|
ATTACHMENTS_DIR,
|
|
220
220
|
LEGACY_ATTACHMENTS_DIR,
|
|
@@ -283,10 +283,10 @@ import {
|
|
|
283
283
|
updateIntegrationsSettings,
|
|
284
284
|
updateOpencodeSettings,
|
|
285
285
|
writeSecureJson
|
|
286
|
-
} from "./chunk-
|
|
286
|
+
} from "./chunk-FT2SQOL4.js";
|
|
287
287
|
import {
|
|
288
288
|
stripNestedElectronEnv
|
|
289
|
-
} from "./chunk-
|
|
289
|
+
} from "./chunk-TLPJHLLM.js";
|
|
290
290
|
import {
|
|
291
291
|
writePrivateFile
|
|
292
292
|
} from "./chunk-JT7R45JB.js";
|
|
@@ -1325,9 +1325,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
1325
1325
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
1326
1326
|
);
|
|
1327
1327
|
}
|
|
1328
|
-
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-
|
|
1328
|
+
const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-JQQLPJM5.js");
|
|
1329
1329
|
if (isGlobalThread2(thread)) {
|
|
1330
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-
|
|
1330
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-UK5LYFN5.js");
|
|
1331
1331
|
ensureGlobalCoordinatorCwd2(
|
|
1332
1332
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
1333
1333
|
);
|
|
@@ -3806,7 +3806,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
3806
3806
|
return readThread(thread.id) ?? thread;
|
|
3807
3807
|
}
|
|
3808
3808
|
async function listLinearIssues(agent, repoPath) {
|
|
3809
|
-
const { getAdapter: getAdapter2 } = await import("./agents-
|
|
3809
|
+
const { getAdapter: getAdapter2 } = await import("./agents-ODBP7J6E.js");
|
|
3810
3810
|
await requireAgent(agent, { requireLinear: true });
|
|
3811
3811
|
const adapter = getAdapter2(agent);
|
|
3812
3812
|
if (!adapter.listLinearIssues) {
|
|
@@ -4349,7 +4349,7 @@ async function adoptThread(input) {
|
|
|
4349
4349
|
messages: input.messages ?? []
|
|
4350
4350
|
});
|
|
4351
4351
|
writeThread(thread);
|
|
4352
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
4352
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-YWCC3WV4.js");
|
|
4353
4353
|
await ensureWorkspace2(repoPath);
|
|
4354
4354
|
return thread;
|
|
4355
4355
|
}
|
|
@@ -5870,7 +5870,7 @@ var Orchestrator = class {
|
|
|
5870
5870
|
orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
|
|
5871
5871
|
});
|
|
5872
5872
|
}
|
|
5873
|
-
const { autoCleanupOrphansEnabled: autoCleanupOrphansEnabled2 } = await import("./app-settings-
|
|
5873
|
+
const { autoCleanupOrphansEnabled: autoCleanupOrphansEnabled2 } = await import("./app-settings-BRF7VKTQ.js");
|
|
5874
5874
|
if (autoCleanupOrphansEnabled2() && shouldRunWorktreeCleanup() && orphans.length > 0) {
|
|
5875
5875
|
await cleanupOrphanWorktrees({ repoPaths });
|
|
5876
5876
|
}
|
|
@@ -6038,7 +6038,7 @@ var Orchestrator = class {
|
|
|
6038
6038
|
}
|
|
6039
6039
|
}
|
|
6040
6040
|
await setup;
|
|
6041
|
-
const { autoRunAfterSetupEnabled: autoRunAfterSetupEnabled2 } = await import("./app-settings-
|
|
6041
|
+
const { autoRunAfterSetupEnabled: autoRunAfterSetupEnabled2 } = await import("./app-settings-BRF7VKTQ.js");
|
|
6042
6042
|
if (autoRunAfterSetupEnabled2()) {
|
|
6043
6043
|
try {
|
|
6044
6044
|
await this.startDev(threadId);
|
|
@@ -6299,7 +6299,7 @@ var Orchestrator = class {
|
|
|
6299
6299
|
}
|
|
6300
6300
|
const isBrightsy = fresh.agent === "brightsy";
|
|
6301
6301
|
const isOrchestration = isOrchestratorThread(fresh);
|
|
6302
|
-
const { autoRenameBranchEnabled: autoRenameBranchEnabled2, getGithubGitAuthMode: getGithubGitAuthMode2 } = await import("./app-settings-
|
|
6302
|
+
const { autoRenameBranchEnabled: autoRenameBranchEnabled2, getGithubGitAuthMode: getGithubGitAuthMode2 } = await import("./app-settings-BRF7VKTQ.js");
|
|
6303
6303
|
const gitAuthMode = getGithubGitAuthMode2();
|
|
6304
6304
|
const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
|
|
6305
6305
|
githubSlug: await resolveGithubRepoSlug(fresh.worktreePath).catch(
|
|
@@ -7007,7 +7007,7 @@ var Orchestrator = class {
|
|
|
7007
7007
|
updateThread(thread.id, { title: meta.title });
|
|
7008
7008
|
}
|
|
7009
7009
|
}
|
|
7010
|
-
const { autoArchiveOnMergeEnabled: autoArchiveOnMergeEnabled2 } = await import("./app-settings-
|
|
7010
|
+
const { autoArchiveOnMergeEnabled: autoArchiveOnMergeEnabled2 } = await import("./app-settings-BRF7VKTQ.js");
|
|
7011
7011
|
const latest = this.requireThread(thread.id);
|
|
7012
7012
|
if (!shouldAutoArchiveOnPrMerge({
|
|
7013
7013
|
previousPrState: prevState || null,
|
|
@@ -7295,7 +7295,7 @@ var Orchestrator = class {
|
|
|
7295
7295
|
this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
|
|
7296
7296
|
if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
|
|
7297
7297
|
try {
|
|
7298
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-
|
|
7298
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-YWCC3WV4.js");
|
|
7299
7299
|
await ensureWorkspace2(thread.repoPath);
|
|
7300
7300
|
} catch {
|
|
7301
7301
|
}
|
|
@@ -7317,7 +7317,7 @@ var Orchestrator = class {
|
|
|
7317
7317
|
await runArchiveScript(thread.repoPath, thread.worktreePath);
|
|
7318
7318
|
} catch {
|
|
7319
7319
|
}
|
|
7320
|
-
const { deleteBranchOnPurgeEnabled: deleteBranchOnPurgeEnabled2 } = await import("./app-settings-
|
|
7320
|
+
const { deleteBranchOnPurgeEnabled: deleteBranchOnPurgeEnabled2 } = await import("./app-settings-BRF7VKTQ.js");
|
|
7321
7321
|
const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled2();
|
|
7322
7322
|
await removeWorktree(thread.repoPath, thread.worktreePath, {
|
|
7323
7323
|
deleteBranch: deleteBranch ? thread.branchName : void 0
|
|
@@ -7338,7 +7338,7 @@ var Orchestrator = class {
|
|
|
7338
7338
|
return restored2;
|
|
7339
7339
|
}
|
|
7340
7340
|
if (!existsSync14(thread.worktreePath)) {
|
|
7341
|
-
const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-
|
|
7341
|
+
const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-7YNSJ224.js");
|
|
7342
7342
|
const { execa: execa5 } = await import("execa");
|
|
7343
7343
|
const slug = thread.worktreePath.split("/").pop();
|
|
7344
7344
|
const dest = thread.worktreePath;
|
|
@@ -7447,7 +7447,7 @@ async function startOrchestration(opts) {
|
|
|
7447
7447
|
sourceRef: "default",
|
|
7448
7448
|
...createOpts
|
|
7449
7449
|
}).catch(async () => {
|
|
7450
|
-
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-
|
|
7450
|
+
const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-7YNSJ224.js");
|
|
7451
7451
|
const repo = await resolveRepoRoot2(repoPath);
|
|
7452
7452
|
const def = await resolveDefaultBranch2(repo);
|
|
7453
7453
|
return orch.createThread({
|
|
@@ -8199,7 +8199,7 @@ function withTimeout(promise, ms, label) {
|
|
|
8199
8199
|
async function startMcpServer() {
|
|
8200
8200
|
const orch = getOrchestrator();
|
|
8201
8201
|
try {
|
|
8202
|
-
const { maxConcurrentAgents: maxConcurrentAgents2 } = await import("./app-settings-
|
|
8202
|
+
const { maxConcurrentAgents: maxConcurrentAgents2 } = await import("./app-settings-BRF7VKTQ.js");
|
|
8203
8203
|
orch.setMaxConcurrent(maxConcurrentAgents2());
|
|
8204
8204
|
} catch {
|
|
8205
8205
|
}
|
|
@@ -8409,7 +8409,7 @@ async function startMcpServer() {
|
|
|
8409
8409
|
registerLinearTools(server);
|
|
8410
8410
|
if (sideboardMcpProfile() !== "worktree") {
|
|
8411
8411
|
const { getCaffeinateHold: getCaffeinateHold2, setCaffeinateHold: setCaffeinateHold2 } = await import("./caffeinate-hold-I7SG6UQR.js");
|
|
8412
|
-
const { resolveNewThreadOptions: resolveNewThreadOptions2, resolveThreadDefaults: resolveThreadDefaults2 } = await import("./app-settings-
|
|
8412
|
+
const { resolveNewThreadOptions: resolveNewThreadOptions2, resolveThreadDefaults: resolveThreadDefaults2 } = await import("./app-settings-BRF7VKTQ.js");
|
|
8413
8413
|
const accountDefaults = resolveThreadDefaults2();
|
|
8414
8414
|
const accountDefaultsHint = `Account defaults: agent=${accountDefaults.agent}, model=${accountDefaults.model?.trim() || "Auto"}, effort=${accountDefaults.effort}`;
|
|
8415
8415
|
server.tool(
|
package/dist/mcp/run-stdio.cjs
CHANGED
|
@@ -57,6 +57,18 @@ function wrapElectronAsNodeLaunch(file, args) {
|
|
|
57
57
|
function isStrippedElectronLaunch(command, args) {
|
|
58
58
|
return command === "/bin/sh" && Boolean(args?.[1]?.includes("ELECTRON_RUN_AS_NODE") && args[1].includes("unset"));
|
|
59
59
|
}
|
|
60
|
+
function isElectronLikeCommand(command) {
|
|
61
|
+
const name = command.trim();
|
|
62
|
+
if (!name) return false;
|
|
63
|
+
if (process.versions.electron && name === process.execPath) return true;
|
|
64
|
+
return /(?:^|[/\\])Electron(?:\.exe)?$/i.test(name) || /Sideboard\.app[/\\]/i.test(name) || /Electron\.app[/\\]/i.test(name);
|
|
65
|
+
}
|
|
66
|
+
function unwrapStrippedElectronLaunch(command, args) {
|
|
67
|
+
if (!isStrippedElectronLaunch(command, args) || !args || args.length < 4) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
return { file: args[3], args: args.slice(4) };
|
|
71
|
+
}
|
|
60
72
|
var NESTED_ELECTRON_ENV_PREFIXES, STRIP_NESTED_ELECTRON_THEN_EXEC;
|
|
61
73
|
var init_nested_electron_env = __esm({
|
|
62
74
|
"src/hook/nested-electron-env.ts"() {
|
|
@@ -6033,22 +6045,52 @@ async function buildInjectedMcpServers(opts) {
|
|
|
6033
6045
|
}
|
|
6034
6046
|
return servers;
|
|
6035
6047
|
}
|
|
6048
|
+
function shSingleQuote(value) {
|
|
6049
|
+
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
6050
|
+
}
|
|
6051
|
+
function cursorSafeMcpLaunch(command, args) {
|
|
6052
|
+
if (process.platform === "win32") {
|
|
6053
|
+
return args && args.length > 0 ? { command, args } : { command };
|
|
6054
|
+
}
|
|
6055
|
+
const unwrapped = unwrapStrippedElectronLaunch(command, args);
|
|
6056
|
+
const file = unwrapped?.file ?? command;
|
|
6057
|
+
const fileArgs = unwrapped?.args ?? args ?? [];
|
|
6058
|
+
if (!isElectronLikeCommand(file)) {
|
|
6059
|
+
return fileArgs.length > 0 ? { command: file, args: fileArgs } : { command: file };
|
|
6060
|
+
}
|
|
6061
|
+
const dir = (0, import_node_path17.join)(appDataDir(), "mcp-launch");
|
|
6062
|
+
(0, import_node_fs17.mkdirSync)(dir, { recursive: true });
|
|
6063
|
+
const wrap = (0, import_node_path17.join)(dir, "cursor-electron-as-node.sh");
|
|
6064
|
+
const execLine = [file, ...fileArgs].map(shSingleQuote).join(" ");
|
|
6065
|
+
(0, import_node_fs17.writeFileSync)(
|
|
6066
|
+
wrap,
|
|
6067
|
+
[
|
|
6068
|
+
"#!/bin/sh",
|
|
6069
|
+
"vars=`printenv | awk -F= '/^(ELECTRON_|CHROME_)/{print $1}'`",
|
|
6070
|
+
'[ -n "$vars" ] && unset $vars',
|
|
6071
|
+
"export ELECTRON_RUN_AS_NODE=1",
|
|
6072
|
+
`exec ${execLine} "$@"`,
|
|
6073
|
+
""
|
|
6074
|
+
].join("\n"),
|
|
6075
|
+
{ mode: 493 }
|
|
6076
|
+
);
|
|
6077
|
+
return { command: wrap };
|
|
6078
|
+
}
|
|
6079
|
+
function mcpSpawnEnv(env) {
|
|
6080
|
+
if (!env) return void 0;
|
|
6081
|
+
const out = { ...env };
|
|
6082
|
+
delete out.ELECTRON_RUN_AS_NODE;
|
|
6083
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
6084
|
+
}
|
|
6036
6085
|
function toCursorMcpServers(servers) {
|
|
6037
6086
|
const out = {};
|
|
6038
6087
|
for (const s of servers) {
|
|
6039
|
-
const env = s.env
|
|
6040
|
-
|
|
6041
|
-
let command = s.command;
|
|
6042
|
-
let args = s.args;
|
|
6043
|
-
if (process.platform !== "win32" && !isStrippedElectronLaunch(command, args)) {
|
|
6044
|
-
const wrapped = wrapElectronAsNodeLaunch(command, args ?? []);
|
|
6045
|
-
command = wrapped.file;
|
|
6046
|
-
args = wrapped.args;
|
|
6047
|
-
}
|
|
6088
|
+
const env = mcpSpawnEnv(s.env);
|
|
6089
|
+
const launch = cursorSafeMcpLaunch(s.command, s.args);
|
|
6048
6090
|
out[s.name] = {
|
|
6049
|
-
command,
|
|
6050
|
-
...args && args.length > 0 ? { args } : {},
|
|
6051
|
-
...env
|
|
6091
|
+
command: launch.command,
|
|
6092
|
+
...launch.args && launch.args.length > 0 ? { args: launch.args } : {},
|
|
6093
|
+
...env ? { env } : {}
|
|
6052
6094
|
};
|
|
6053
6095
|
}
|
|
6054
6096
|
return out;
|
|
@@ -6061,8 +6103,9 @@ function toCodexMcpConfigArgs(servers) {
|
|
|
6061
6103
|
if (s.args?.length) {
|
|
6062
6104
|
args.push("-c", `${prefix}.args=${JSON.stringify(s.args)}`);
|
|
6063
6105
|
}
|
|
6064
|
-
|
|
6065
|
-
|
|
6106
|
+
const env = mcpSpawnEnv(s.env);
|
|
6107
|
+
if (env) {
|
|
6108
|
+
for (const [key, value] of Object.entries(env)) {
|
|
6066
6109
|
args.push("-c", `${prefix}.env.${key}=${JSON.stringify(value)}`);
|
|
6067
6110
|
}
|
|
6068
6111
|
}
|
|
@@ -6075,11 +6118,12 @@ function toCodexMcpConfigArgs(servers) {
|
|
|
6075
6118
|
function toOpencodeMcpConfigContent(servers) {
|
|
6076
6119
|
const mcp = {};
|
|
6077
6120
|
for (const s of servers) {
|
|
6121
|
+
const env = mcpSpawnEnv(s.env);
|
|
6078
6122
|
mcp[s.name] = {
|
|
6079
6123
|
type: "local",
|
|
6080
6124
|
command: [s.command, ...s.args ?? []],
|
|
6081
6125
|
enabled: true,
|
|
6082
|
-
...
|
|
6126
|
+
...env ? { environment: env } : {}
|
|
6083
6127
|
};
|
|
6084
6128
|
}
|
|
6085
6129
|
return JSON.stringify({ mcp });
|
|
@@ -6088,10 +6132,11 @@ function writeMcpServersConfig(servers) {
|
|
|
6088
6132
|
if (servers.length === 0) return null;
|
|
6089
6133
|
const mcpServers = {};
|
|
6090
6134
|
for (const s of servers) {
|
|
6135
|
+
const env = mcpSpawnEnv(s.env);
|
|
6091
6136
|
mcpServers[s.name] = {
|
|
6092
6137
|
command: s.command,
|
|
6093
6138
|
...s.args ? { args: s.args } : {},
|
|
6094
|
-
...
|
|
6139
|
+
...env ? { env } : {}
|
|
6095
6140
|
};
|
|
6096
6141
|
}
|
|
6097
6142
|
const dir = (0, import_node_fs17.mkdtempSync)((0, import_node_path17.join)((0, import_node_os6.tmpdir)(), "sideboard-mcp-"));
|
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-JE75QW2I.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-WANQFU3S.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-UHTNJKZX.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-OB6IRIFV.js";
|
|
53
53
|
import {
|
|
54
54
|
addPrStackLayer,
|
|
55
55
|
allocateTeamName,
|
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
takenSlugsFromThread,
|
|
90
90
|
threadDisplayLabel,
|
|
91
91
|
worktreeNameFromPath
|
|
92
|
-
} from "../chunk-
|
|
92
|
+
} from "../chunk-ZXYWWSHZ.js";
|
|
93
93
|
import {
|
|
94
94
|
ATTACHMENTS_DIR,
|
|
95
95
|
LEGACY_ATTACHMENTS_DIR,
|
|
@@ -124,7 +124,7 @@ import {
|
|
|
124
124
|
stripNestedElectronEnv,
|
|
125
125
|
updateAdvancedSettings,
|
|
126
126
|
writeSecureJson
|
|
127
|
-
} from "../chunk-
|
|
127
|
+
} from "../chunk-6LFV4VFI.js";
|
|
128
128
|
import {
|
|
129
129
|
writePrivateFile
|
|
130
130
|
} from "../chunk-NSTQ6QKD.js";
|
|
@@ -896,9 +896,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
|
|
|
896
896
|
`Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
|
|
897
897
|
);
|
|
898
898
|
}
|
|
899
|
-
const { isGlobalThread: isGlobalThread2 } = await import("../global-workspace-
|
|
899
|
+
const { isGlobalThread: isGlobalThread2 } = await import("../global-workspace-2YZ2V4I5.js");
|
|
900
900
|
if (isGlobalThread2(thread)) {
|
|
901
|
-
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("../coordinator-prompt-
|
|
901
|
+
const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("../coordinator-prompt-CI5SHONJ.js");
|
|
902
902
|
ensureGlobalCoordinatorCwd2(
|
|
903
903
|
isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
|
|
904
904
|
);
|
|
@@ -1792,7 +1792,7 @@ async function createThread(input, _onSetupLine) {
|
|
|
1792
1792
|
return readThread(thread.id) ?? thread;
|
|
1793
1793
|
}
|
|
1794
1794
|
async function listLinearIssues(agent, repoPath) {
|
|
1795
|
-
const { getAdapter: getAdapter2 } = await import("../agents-
|
|
1795
|
+
const { getAdapter: getAdapter2 } = await import("../agents-LMUFTGKF.js");
|
|
1796
1796
|
await requireAgent(agent, { requireLinear: true });
|
|
1797
1797
|
const adapter = getAdapter2(agent);
|
|
1798
1798
|
if (!adapter.listLinearIssues) {
|
|
@@ -2660,7 +2660,7 @@ async function adoptThread(input) {
|
|
|
2660
2660
|
messages: input.messages ?? []
|
|
2661
2661
|
});
|
|
2662
2662
|
writeThread(thread);
|
|
2663
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("../workspaces-
|
|
2663
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("../workspaces-FDO5L4NI.js");
|
|
2664
2664
|
await ensureWorkspace2(repoPath);
|
|
2665
2665
|
return thread;
|
|
2666
2666
|
}
|
|
@@ -4652,7 +4652,7 @@ var Orchestrator = class {
|
|
|
4652
4652
|
orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
|
|
4653
4653
|
});
|
|
4654
4654
|
}
|
|
4655
|
-
const { autoCleanupOrphansEnabled } = await import("../app-settings-
|
|
4655
|
+
const { autoCleanupOrphansEnabled } = await import("../app-settings-ZXPAB3QN.js");
|
|
4656
4656
|
if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
|
|
4657
4657
|
await cleanupOrphanWorktrees({ repoPaths });
|
|
4658
4658
|
}
|
|
@@ -4820,7 +4820,7 @@ var Orchestrator = class {
|
|
|
4820
4820
|
}
|
|
4821
4821
|
}
|
|
4822
4822
|
await setup;
|
|
4823
|
-
const { autoRunAfterSetupEnabled } = await import("../app-settings-
|
|
4823
|
+
const { autoRunAfterSetupEnabled } = await import("../app-settings-ZXPAB3QN.js");
|
|
4824
4824
|
if (autoRunAfterSetupEnabled()) {
|
|
4825
4825
|
try {
|
|
4826
4826
|
await this.startDev(threadId);
|
|
@@ -5081,7 +5081,7 @@ var Orchestrator = class {
|
|
|
5081
5081
|
}
|
|
5082
5082
|
const isBrightsy = fresh.agent === "brightsy";
|
|
5083
5083
|
const isOrchestration = isOrchestratorThread(fresh);
|
|
5084
|
-
const { autoRenameBranchEnabled, getGithubGitAuthMode } = await import("../app-settings-
|
|
5084
|
+
const { autoRenameBranchEnabled, getGithubGitAuthMode } = await import("../app-settings-ZXPAB3QN.js");
|
|
5085
5085
|
const gitAuthMode = getGithubGitAuthMode();
|
|
5086
5086
|
const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
|
|
5087
5087
|
githubSlug: await resolveGithubRepoSlug(fresh.worktreePath).catch(
|
|
@@ -5789,7 +5789,7 @@ var Orchestrator = class {
|
|
|
5789
5789
|
updateThread(thread.id, { title: meta.title });
|
|
5790
5790
|
}
|
|
5791
5791
|
}
|
|
5792
|
-
const { autoArchiveOnMergeEnabled } = await import("../app-settings-
|
|
5792
|
+
const { autoArchiveOnMergeEnabled } = await import("../app-settings-ZXPAB3QN.js");
|
|
5793
5793
|
const latest = this.requireThread(thread.id);
|
|
5794
5794
|
if (!shouldAutoArchiveOnPrMerge({
|
|
5795
5795
|
previousPrState: prevState || null,
|
|
@@ -6077,7 +6077,7 @@ var Orchestrator = class {
|
|
|
6077
6077
|
this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
|
|
6078
6078
|
if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
|
|
6079
6079
|
try {
|
|
6080
|
-
const { ensureWorkspace: ensureWorkspace2 } = await import("../workspaces-
|
|
6080
|
+
const { ensureWorkspace: ensureWorkspace2 } = await import("../workspaces-FDO5L4NI.js");
|
|
6081
6081
|
await ensureWorkspace2(thread.repoPath);
|
|
6082
6082
|
} catch {
|
|
6083
6083
|
}
|
|
@@ -6099,7 +6099,7 @@ var Orchestrator = class {
|
|
|
6099
6099
|
await runArchiveScript(thread.repoPath, thread.worktreePath);
|
|
6100
6100
|
} catch {
|
|
6101
6101
|
}
|
|
6102
|
-
const { deleteBranchOnPurgeEnabled } = await import("../app-settings-
|
|
6102
|
+
const { deleteBranchOnPurgeEnabled } = await import("../app-settings-ZXPAB3QN.js");
|
|
6103
6103
|
const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
|
|
6104
6104
|
await removeWorktree(thread.repoPath, thread.worktreePath, {
|
|
6105
6105
|
deleteBranch: deleteBranch ? thread.branchName : void 0
|
|
@@ -6120,7 +6120,7 @@ var Orchestrator = class {
|
|
|
6120
6120
|
return restored2;
|
|
6121
6121
|
}
|
|
6122
6122
|
if (!existsSync14(thread.worktreePath)) {
|
|
6123
|
-
const { createThreadWorktree: createThreadWorktree2 } = await import("../worktree-
|
|
6123
|
+
const { createThreadWorktree: createThreadWorktree2 } = await import("../worktree-4555QBQ7.js");
|
|
6124
6124
|
const { execa: execa5 } = await import("execa");
|
|
6125
6125
|
const slug = thread.worktreePath.split("/").pop();
|
|
6126
6126
|
const dest = thread.worktreePath;
|
|
@@ -7291,7 +7291,7 @@ function withTimeout(promise, ms, label) {
|
|
|
7291
7291
|
async function startMcpServer() {
|
|
7292
7292
|
const orch = getOrchestrator();
|
|
7293
7293
|
try {
|
|
7294
|
-
const { maxConcurrentAgents } = await import("../app-settings-
|
|
7294
|
+
const { maxConcurrentAgents } = await import("../app-settings-ZXPAB3QN.js");
|
|
7295
7295
|
orch.setMaxConcurrent(maxConcurrentAgents());
|
|
7296
7296
|
} catch {
|
|
7297
7297
|
}
|
|
@@ -7501,7 +7501,7 @@ async function startMcpServer() {
|
|
|
7501
7501
|
registerLinearTools(server);
|
|
7502
7502
|
if (sideboardMcpProfile() !== "worktree") {
|
|
7503
7503
|
const { getCaffeinateHold, setCaffeinateHold } = await import("../caffeinate-hold-U3QJBV67.js");
|
|
7504
|
-
const { resolveNewThreadOptions: resolveNewThreadOptions2, resolveThreadDefaults } = await import("../app-settings-
|
|
7504
|
+
const { resolveNewThreadOptions: resolveNewThreadOptions2, resolveThreadDefaults } = await import("../app-settings-ZXPAB3QN.js");
|
|
7505
7505
|
const accountDefaults = resolveThreadDefaults();
|
|
7506
7506
|
const accountDefaultsHint = `Account defaults: agent=${accountDefaults.agent}, model=${accountDefaults.model?.trim() || "Auto"}, effort=${accountDefaults.effort}`;
|
|
7507
7507
|
server.tool(
|
|
@@ -6,13 +6,13 @@ 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-WANQFU3S.js";
|
|
10
|
+
import "./chunk-UHTNJKZX.js";
|
|
11
|
+
import "./chunk-OB6IRIFV.js";
|
|
12
|
+
import "./chunk-ZXYWWSHZ.js";
|
|
13
13
|
import "./chunk-B3SJXYIJ.js";
|
|
14
14
|
import "./chunk-JOF3XIEM.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-6LFV4VFI.js";
|
|
16
16
|
import "./chunk-NSTQ6QKD.js";
|
|
17
17
|
import "./chunk-KGZBYWZ3.js";
|
|
18
18
|
import "./chunk-JL4SJ6V7.js";
|
|
@@ -4,13 +4,13 @@ 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-6EZRSCIT.js";
|
|
8
|
+
import "./chunk-B2KIO2SD.js";
|
|
9
|
+
import "./chunk-VZ2L4AEJ.js";
|
|
10
|
+
import "./chunk-7D27DD2X.js";
|
|
11
11
|
import "./chunk-FKOIHGKV.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-FT2SQOL4.js";
|
|
13
|
+
import "./chunk-TLPJHLLM.js";
|
|
14
14
|
import "./chunk-JT7R45JB.js";
|
|
15
15
|
import "./chunk-3WA37BRI.js";
|
|
16
16
|
import "./chunk-77WWLBCI.js";
|
|
@@ -46,10 +46,10 @@ import {
|
|
|
46
46
|
worktreeDisplayLabel,
|
|
47
47
|
worktreeDisplayLabelForGroup,
|
|
48
48
|
worktreeNameFromPath
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-ZXYWWSHZ.js";
|
|
50
50
|
import "./chunk-B3SJXYIJ.js";
|
|
51
51
|
import "./chunk-JOF3XIEM.js";
|
|
52
|
-
import "./chunk-
|
|
52
|
+
import "./chunk-6LFV4VFI.js";
|
|
53
53
|
import "./chunk-NSTQ6QKD.js";
|
|
54
54
|
import "./chunk-KGZBYWZ3.js";
|
|
55
55
|
import "./chunk-JL4SJ6V7.js";
|
|
@@ -44,10 +44,10 @@ import {
|
|
|
44
44
|
worktreeDisplayLabel,
|
|
45
45
|
worktreeDisplayLabelForGroup,
|
|
46
46
|
worktreeNameFromPath
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-7D27DD2X.js";
|
|
48
48
|
import "./chunk-FKOIHGKV.js";
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-FT2SQOL4.js";
|
|
50
|
+
import "./chunk-TLPJHLLM.js";
|
|
51
51
|
import "./chunk-JT7R45JB.js";
|
|
52
52
|
import "./chunk-3WA37BRI.js";
|
|
53
53
|
import "./chunk-77WWLBCI.js";
|