@sideboard-ai/core 0.1.37 → 0.1.38

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.
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  cursorSdkMessageToEvents,
4
4
  formatUnknownDetail
5
- } from "../chunk-BSZX63TV.js";
5
+ } from "../chunk-PU27NUO4.js";
6
6
  import {
7
7
  appDataDir
8
8
  } from "../chunk-M37RITA6.js";
@@ -21,12 +21,12 @@ import {
21
21
  opencodeAdapter,
22
22
  permissionMode,
23
23
  resolveCursorModelId
24
- } from "./chunk-5KZLWNBS.js";
24
+ } from "./chunk-BEXVE7LX.js";
25
25
  import "./chunk-ILQK4P5R.js";
26
26
  import {
27
27
  cursorSdkMessageToEvents,
28
28
  parseCursorRunnerLine
29
- } from "./chunk-BSZX63TV.js";
29
+ } from "./chunk-PU27NUO4.js";
30
30
  import "./chunk-YZ23S32T.js";
31
31
  import "./chunk-M37RITA6.js";
32
32
  import {
@@ -10,7 +10,7 @@ import {
10
10
  formatUnknownDetail,
11
11
  looksLikeAgentFailureMessage,
12
12
  parseCursorRunnerLine
13
- } from "./chunk-BSZX63TV.js";
13
+ } from "./chunk-PU27NUO4.js";
14
14
  import {
15
15
  claudeChromeEnabled,
16
16
  loadAppSettings,
@@ -434,6 +434,30 @@ import { createRequire } from "module";
434
434
  import { tmpdir } from "os";
435
435
  import { dirname, join } from "path";
436
436
  import { fileURLToPath } from "url";
437
+
438
+ // src/agents/node-launch.ts
439
+ function isAsarPath(filePath) {
440
+ return /\.asar([/\\]|$)/.test(filePath);
441
+ }
442
+ async function resolveNodeLaunch(scriptPath) {
443
+ if (isAsarPath(scriptPath)) {
444
+ return {
445
+ file: process.execPath,
446
+ env: { ELECTRON_RUN_AS_NODE: "1" }
447
+ };
448
+ }
449
+ const whichNode = await run("which", ["node"], { reject: false });
450
+ const nodeBin = whichNode.exitCode === 0 && whichNode.stdout.trim() ? whichNode.stdout.trim() : null;
451
+ if (nodeBin) {
452
+ return { file: nodeBin, env: {} };
453
+ }
454
+ return {
455
+ file: process.execPath,
456
+ env: { ELECTRON_RUN_AS_NODE: "1" }
457
+ };
458
+ }
459
+
460
+ // src/agents/injected-mcp.ts
437
461
  var SIDEBOARD_MCP_ALLOWED_TOOLS = [
438
462
  "mcp__sideboard",
439
463
  "mcp__sideboard__*"
@@ -536,11 +560,13 @@ async function resolveSideboardMcpServer() {
536
560
  const entry = findSideboardMcpJsEntry();
537
561
  if (entry) {
538
562
  const isCli = /[/\\]cli[/\\]dist[/\\]index\.js$/.test(entry);
563
+ const scriptArgs = isCli ? [entry, "mcp"] : [entry];
564
+ const launch = await resolveNodeLaunch(entry);
539
565
  return {
540
566
  name: "sideboard",
541
- // Use `node` (not process.execPath) — under Electron execPath is Electron itself.
542
- command: "node",
543
- args: isCli ? [entry, "mcp"] : [entry]
567
+ command: launch.file,
568
+ args: scriptArgs,
569
+ ...Object.keys(launch.env).length > 0 ? { env: launch.env } : {}
544
570
  };
545
571
  }
546
572
  const which = await run("which", ["sideboard"], { reject: false });
@@ -1324,16 +1350,14 @@ var cursorAdapter = {
1324
1350
  };
1325
1351
  const runner = cursorRunnerPath();
1326
1352
  const isTs = runner.endsWith(".ts");
1327
- const whichNode = await run("which", ["node"], { reject: false });
1328
- const nodeBin = whichNode.exitCode === 0 && whichNode.stdout.trim() ? whichNode.stdout.trim() : null;
1329
- const file = nodeBin || process.execPath;
1353
+ const launch = await resolveNodeLaunch(runner);
1330
1354
  return {
1331
- file,
1355
+ file: launch.file,
1332
1356
  args: isTs ? ["--import", "tsx", runner] : [runner],
1333
1357
  cwd: thread.worktreePath,
1334
1358
  stdin: JSON.stringify(req),
1335
1359
  env: {
1336
- ...nodeBin ? {} : { ELECTRON_RUN_AS_NODE: "1" },
1360
+ ...launch.env,
1337
1361
  ...apiKey ? { CURSOR_API_KEY: apiKey } : {}
1338
1362
  }
1339
1363
  };
@@ -52,6 +52,10 @@ function pushTurnStderr(tail, line, maxLines = 12) {
52
52
  }
53
53
  function summarizeTurnStderr(tail, maxChars = 500) {
54
54
  if (tail.length === 0) return "";
55
+ const moduleMissing = [...tail].reverse().find((line) => /cannot find module/i.test(line));
56
+ if (moduleMissing) {
57
+ return moduleMissing.length <= maxChars ? moduleMissing : moduleMissing.slice(0, maxChars);
58
+ }
55
59
  const joined = tail.slice(-6).join("\n").trim();
56
60
  if (joined.length <= maxChars) return joined;
57
61
  return joined.slice(joined.length - maxChars);
@@ -25,14 +25,14 @@ import {
25
25
  allAdapters,
26
26
  getAdapter,
27
27
  parseBrightsyCliLine
28
- } from "./chunk-5KZLWNBS.js";
28
+ } from "./chunk-BEXVE7LX.js";
29
29
  import {
30
30
  fallbackTurnFailDetail,
31
31
  formatTurnExitError,
32
32
  looksLikeAgentFailureMessage,
33
33
  pushTurnStderr,
34
34
  summarizeTurnStderr
35
- } from "./chunk-BSZX63TV.js";
35
+ } from "./chunk-PU27NUO4.js";
36
36
  import {
37
37
  childEnvWithAppSettings,
38
38
  getLinearApiKey,
@@ -2606,7 +2606,7 @@ async function createThread(input, onSetupLine) {
2606
2606
  return readThread(thread.id) ?? thread;
2607
2607
  }
2608
2608
  async function listLinearIssues(agent, repoPath) {
2609
- const { getAdapter: getAdapter2 } = await import("./agents-3CD7GH2V.js");
2609
+ const { getAdapter: getAdapter2 } = await import("./agents-DDW4NBBW.js");
2610
2610
  await requireAgent(agent, { requireLinear: true });
2611
2611
  const adapter = getAdapter2(agent);
2612
2612
  if (!adapter.listLinearIssues) {
package/dist/index.cjs CHANGED
@@ -3797,6 +3797,10 @@ function pushTurnStderr(tail, line, maxLines = 12) {
3797
3797
  }
3798
3798
  function summarizeTurnStderr(tail, maxChars = 500) {
3799
3799
  if (tail.length === 0) return "";
3800
+ const moduleMissing = [...tail].reverse().find((line) => /cannot find module/i.test(line));
3801
+ if (moduleMissing) {
3802
+ return moduleMissing.length <= maxChars ? moduleMissing : moduleMissing.slice(0, maxChars);
3803
+ }
3800
3804
  const joined = tail.slice(-6).join("\n").trim();
3801
3805
  if (joined.length <= maxChars) return joined;
3802
3806
  return joined.slice(joined.length - maxChars);
@@ -4256,6 +4260,34 @@ var init_claude_mcp = __esm({
4256
4260
  }
4257
4261
  });
4258
4262
 
4263
+ // src/agents/node-launch.ts
4264
+ function isAsarPath(filePath) {
4265
+ return /\.asar([/\\]|$)/.test(filePath);
4266
+ }
4267
+ async function resolveNodeLaunch(scriptPath) {
4268
+ if (isAsarPath(scriptPath)) {
4269
+ return {
4270
+ file: process.execPath,
4271
+ env: { ELECTRON_RUN_AS_NODE: "1" }
4272
+ };
4273
+ }
4274
+ const whichNode = await run("which", ["node"], { reject: false });
4275
+ const nodeBin = whichNode.exitCode === 0 && whichNode.stdout.trim() ? whichNode.stdout.trim() : null;
4276
+ if (nodeBin) {
4277
+ return { file: nodeBin, env: {} };
4278
+ }
4279
+ return {
4280
+ file: process.execPath,
4281
+ env: { ELECTRON_RUN_AS_NODE: "1" }
4282
+ };
4283
+ }
4284
+ var init_node_launch = __esm({
4285
+ "src/agents/node-launch.ts"() {
4286
+ "use strict";
4287
+ init_run();
4288
+ }
4289
+ });
4290
+
4259
4291
  // src/agents/injected-mcp.ts
4260
4292
  async function resolveBrightsyMcpCommand() {
4261
4293
  const now = Date.now();
@@ -4345,11 +4377,13 @@ async function resolveSideboardMcpServer() {
4345
4377
  const entry = findSideboardMcpJsEntry();
4346
4378
  if (entry) {
4347
4379
  const isCli = /[/\\]cli[/\\]dist[/\\]index\.js$/.test(entry);
4380
+ const scriptArgs = isCli ? [entry, "mcp"] : [entry];
4381
+ const launch = await resolveNodeLaunch(entry);
4348
4382
  return {
4349
4383
  name: "sideboard",
4350
- // Use `node` (not process.execPath) — under Electron execPath is Electron itself.
4351
- command: "node",
4352
- args: isCli ? [entry, "mcp"] : [entry]
4384
+ command: launch.file,
4385
+ args: scriptArgs,
4386
+ ...Object.keys(launch.env).length > 0 ? { env: launch.env } : {}
4353
4387
  };
4354
4388
  }
4355
4389
  const which = await run("which", ["sideboard"], { reject: false });
@@ -4410,6 +4444,7 @@ var init_injected_mcp = __esm({
4410
4444
  init_run();
4411
4445
  init_config();
4412
4446
  init_connected_teams();
4447
+ init_node_launch();
4413
4448
  import_meta = {};
4414
4449
  SIDEBOARD_MCP_ALLOWED_TOOLS = [
4415
4450
  "mcp__sideboard",
@@ -5241,6 +5276,7 @@ var init_cursor = __esm({
5241
5276
  init_run();
5242
5277
  init_app_settings();
5243
5278
  init_cursor_events();
5279
+ init_node_launch();
5244
5280
  init_turn_input();
5245
5281
  init_cursor_events();
5246
5282
  import_meta2 = {};
@@ -5301,16 +5337,14 @@ var init_cursor = __esm({
5301
5337
  };
5302
5338
  const runner = cursorRunnerPath();
5303
5339
  const isTs = runner.endsWith(".ts");
5304
- const whichNode = await run("which", ["node"], { reject: false });
5305
- const nodeBin = whichNode.exitCode === 0 && whichNode.stdout.trim() ? whichNode.stdout.trim() : null;
5306
- const file = nodeBin || process.execPath;
5340
+ const launch = await resolveNodeLaunch(runner);
5307
5341
  return {
5308
- file,
5342
+ file: launch.file,
5309
5343
  args: isTs ? ["--import", "tsx", runner] : [runner],
5310
5344
  cwd: thread.worktreePath,
5311
5345
  stdin: JSON.stringify(req),
5312
5346
  env: {
5313
- ...nodeBin ? {} : { ELECTRON_RUN_AS_NODE: "1" },
5347
+ ...launch.env,
5314
5348
  ...apiKey ? { CURSOR_API_KEY: apiKey } : {}
5315
5349
  }
5316
5350
  };
package/dist/index.js CHANGED
@@ -101,7 +101,7 @@ import {
101
101
  withAgentInstructions,
102
102
  worktreeCleanupSettings,
103
103
  writeWorktreeFile
104
- } from "./chunk-E4TRCRKH.js";
104
+ } from "./chunk-UKDAGGTU.js";
105
105
  import {
106
106
  addWorkspace,
107
107
  ensureWorkspace,
@@ -176,7 +176,7 @@ import {
176
176
  resolveCursorModelId,
177
177
  sanitizeMcpServerName,
178
178
  writeInjectedMcpConfig
179
- } from "./chunk-5KZLWNBS.js";
179
+ } from "./chunk-BEXVE7LX.js";
180
180
  import {
181
181
  brightsyConfigPath,
182
182
  brightsyMcpServerName,
@@ -192,7 +192,7 @@ import {
192
192
  import {
193
193
  cursorSdkMessageToEvents,
194
194
  parseCursorRunnerLine
195
- } from "./chunk-BSZX63TV.js";
195
+ } from "./chunk-PU27NUO4.js";
196
196
  import {
197
197
  HARNESS_ENV_KEYS,
198
198
  appSettingsPath,
@@ -83,6 +83,10 @@ function pushTurnStderr(tail, line, maxLines = 12) {
83
83
  }
84
84
  function summarizeTurnStderr(tail, maxChars = 500) {
85
85
  if (tail.length === 0) return "";
86
+ const moduleMissing = [...tail].reverse().find((line) => /cannot find module/i.test(line));
87
+ if (moduleMissing) {
88
+ return moduleMissing.length <= maxChars ? moduleMissing : moduleMissing.slice(0, maxChars);
89
+ }
86
90
  const joined = tail.slice(-6).join("\n").trim();
87
91
  if (joined.length <= maxChars) return joined;
88
92
  return joined.slice(joined.length - maxChars);
@@ -3902,6 +3906,34 @@ var init_claude_mcp = __esm({
3902
3906
  }
3903
3907
  });
3904
3908
 
3909
+ // src/agents/node-launch.ts
3910
+ function isAsarPath(filePath) {
3911
+ return /\.asar([/\\]|$)/.test(filePath);
3912
+ }
3913
+ async function resolveNodeLaunch(scriptPath) {
3914
+ if (isAsarPath(scriptPath)) {
3915
+ return {
3916
+ file: process.execPath,
3917
+ env: { ELECTRON_RUN_AS_NODE: "1" }
3918
+ };
3919
+ }
3920
+ const whichNode = await run("which", ["node"], { reject: false });
3921
+ const nodeBin = whichNode.exitCode === 0 && whichNode.stdout.trim() ? whichNode.stdout.trim() : null;
3922
+ if (nodeBin) {
3923
+ return { file: nodeBin, env: {} };
3924
+ }
3925
+ return {
3926
+ file: process.execPath,
3927
+ env: { ELECTRON_RUN_AS_NODE: "1" }
3928
+ };
3929
+ }
3930
+ var init_node_launch = __esm({
3931
+ "src/agents/node-launch.ts"() {
3932
+ "use strict";
3933
+ init_run();
3934
+ }
3935
+ });
3936
+
3905
3937
  // src/agents/injected-mcp.ts
3906
3938
  async function resolveBrightsyMcpCommand() {
3907
3939
  const now = Date.now();
@@ -3991,11 +4023,13 @@ async function resolveSideboardMcpServer() {
3991
4023
  const entry = findSideboardMcpJsEntry();
3992
4024
  if (entry) {
3993
4025
  const isCli = /[/\\]cli[/\\]dist[/\\]index\.js$/.test(entry);
4026
+ const scriptArgs = isCli ? [entry, "mcp"] : [entry];
4027
+ const launch = await resolveNodeLaunch(entry);
3994
4028
  return {
3995
4029
  name: "sideboard",
3996
- // Use `node` (not process.execPath) — under Electron execPath is Electron itself.
3997
- command: "node",
3998
- args: isCli ? [entry, "mcp"] : [entry]
4030
+ command: launch.file,
4031
+ args: scriptArgs,
4032
+ ...Object.keys(launch.env).length > 0 ? { env: launch.env } : {}
3999
4033
  };
4000
4034
  }
4001
4035
  const which = await run("which", ["sideboard"], { reject: false });
@@ -4053,6 +4087,7 @@ var init_injected_mcp = __esm({
4053
4087
  init_run();
4054
4088
  init_config();
4055
4089
  init_connected_teams();
4090
+ init_node_launch();
4056
4091
  import_meta = {};
4057
4092
  SIDEBOARD_MCP_ALLOWED_TOOLS = [
4058
4093
  "mcp__sideboard",
@@ -4880,6 +4915,7 @@ var init_cursor = __esm({
4880
4915
  init_run();
4881
4916
  init_app_settings();
4882
4917
  init_cursor_events();
4918
+ init_node_launch();
4883
4919
  init_turn_input();
4884
4920
  init_cursor_events();
4885
4921
  import_meta2 = {};
@@ -4940,16 +4976,14 @@ var init_cursor = __esm({
4940
4976
  };
4941
4977
  const runner = cursorRunnerPath();
4942
4978
  const isTs = runner.endsWith(".ts");
4943
- const whichNode = await run("which", ["node"], { reject: false });
4944
- const nodeBin = whichNode.exitCode === 0 && whichNode.stdout.trim() ? whichNode.stdout.trim() : null;
4945
- const file = nodeBin || process.execPath;
4979
+ const launch = await resolveNodeLaunch(runner);
4946
4980
  return {
4947
- file,
4981
+ file: launch.file,
4948
4982
  args: isTs ? ["--import", "tsx", runner] : [runner],
4949
4983
  cwd: thread.worktreePath,
4950
4984
  stdin: JSON.stringify(req),
4951
4985
  env: {
4952
- ...nodeBin ? {} : { ELECTRON_RUN_AS_NODE: "1" },
4986
+ ...launch.env,
4953
4987
  ...apiKey ? { CURSOR_API_KEY: apiKey } : {}
4954
4988
  }
4955
4989
  };
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  startMcpServer
4
- } from "../chunk-E4TRCRKH.js";
4
+ } from "../chunk-UKDAGGTU.js";
5
5
  import "../chunk-FVGRUZHI.js";
6
6
  import "../chunk-IS3AGU33.js";
7
7
  import "../chunk-PTASB7SJ.js";
8
- import "../chunk-5KZLWNBS.js";
8
+ import "../chunk-BEXVE7LX.js";
9
9
  import "../chunk-ILQK4P5R.js";
10
- import "../chunk-BSZX63TV.js";
10
+ import "../chunk-PU27NUO4.js";
11
11
  import "../chunk-YZ23S32T.js";
12
12
  import "../chunk-XBEQI5H4.js";
13
13
  import "../chunk-HYRHI3QU.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sideboard-ai/core",
3
- "version": "0.1.37",
3
+ "version": "0.1.38",
4
4
  "description": "Sideboard core — orchestration, agents, git worktrees, MCP server",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",