@sideboard-ai/core 0.1.81 → 0.1.83

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.
Files changed (34) hide show
  1. package/dist/agents/cursor-runner.cjs +18 -0
  2. package/dist/agents/cursor-runner.js +4 -0
  3. package/dist/{agents-UQ7D6U6L.js → agents-3YPUZME7.js} +6 -5
  4. package/dist/{agents-EBKJ55PN.js → agents-4KRD46KG.js} +5 -5
  5. package/dist/{app-settings-NILNWNNQ.js → app-settings-GVSOIJLZ.js} +1 -1
  6. package/dist/{app-settings-6IOQYGBK.js → app-settings-MQXL7OUF.js} +2 -1
  7. package/dist/{chunk-P5VDPGAN.js → chunk-DJFGX4RT.js} +3 -3
  8. package/dist/{chunk-CQBQWX73.js → chunk-E2MIA7DO.js} +8 -3
  9. package/dist/{chunk-4HJK57XU.js → chunk-ERJS3ZDP.js} +8 -3
  10. package/dist/{chunk-YVVXWWCC.js → chunk-GD2FM6FN.js} +81 -49
  11. package/dist/{chunk-FUUVPN4A.js → chunk-HBBXS2FR.js} +78 -49
  12. package/dist/chunk-IZ7RPF54.js +36 -0
  13. package/dist/{chunk-4AVU4QXO.js → chunk-JMRJ4F5B.js} +19 -8
  14. package/dist/{chunk-XNECBC6T.js → chunk-JW6YFPQE.js} +20 -7
  15. package/dist/{chunk-K553XK7M.js → chunk-LVTNWH7B.js} +2 -2
  16. package/dist/{chunk-6F2TQFJE.js → chunk-NXXT5SE3.js} +3 -3
  17. package/dist/{chunk-TDJ43HUD.js → chunk-RS54WYYH.js} +2 -2
  18. package/dist/{chunk-XKNBSYA7.js → chunk-UHGN4KCL.js} +35 -1
  19. package/dist/{chunk-IFPN6TER.js → chunk-YO3CYL6B.js} +4 -1
  20. package/dist/{coordinator-prompt-JQF72JKX.js → coordinator-prompt-46JE4NQR.js} +4 -3
  21. package/dist/{coordinator-prompt-NYNEFKIV.js → coordinator-prompt-6ICA54JR.js} +3 -3
  22. package/dist/{global-workspace-DZM4ZFGU.js → global-workspace-GSLCEB5E.js} +5 -4
  23. package/dist/{global-workspace-NUMUJRWG.js → global-workspace-OBRWUPZG.js} +4 -4
  24. package/dist/index.cjs +182 -77
  25. package/dist/index.d.cts +36 -9
  26. package/dist/index.d.ts +36 -9
  27. package/dist/index.js +67 -43
  28. package/dist/mcp/run-stdio.cjs +180 -77
  29. package/dist/mcp/run-stdio.js +59 -42
  30. package/dist/{workspaces-QLRCOXAY.js → workspaces-7B3PTEF4.js} +6 -5
  31. package/dist/{workspaces-SUU2GO3A.js → workspaces-RJIWQB6J.js} +5 -5
  32. package/dist/{worktree-5VLLFI5W.js → worktree-HSN5LWY6.js} +3 -2
  33. package/dist/{worktree-UNSOCYZU.js → worktree-U3UIID2K.js} +2 -2
  34. package/package.json +1 -1
@@ -0,0 +1,36 @@
1
+ // src/hook/nested-electron-env.ts
2
+ var NESTED_ELECTRON_ENV_PREFIXES = ["ELECTRON_", "CHROME_"];
3
+ function isNestedElectronEnvKey(key) {
4
+ return NESTED_ELECTRON_ENV_PREFIXES.some((prefix) => key.startsWith(prefix));
5
+ }
6
+ function stripNestedElectronEnv(env) {
7
+ const out = { ...env };
8
+ for (const key of Object.keys(out)) {
9
+ if (isNestedElectronEnvKey(key)) delete out[key];
10
+ }
11
+ return out;
12
+ }
13
+ function dropNestedElectronEnvFromProcess(env = process.env) {
14
+ for (const key of Object.keys(env)) {
15
+ if (isNestedElectronEnvKey(key)) delete env[key];
16
+ }
17
+ }
18
+ var STRIP_NESTED_ELECTRON_THEN_EXEC = [
19
+ "vars=`printenv | awk -F= '/^(ELECTRON_|CHROME_)/{print $1}'`",
20
+ '[ -n "$vars" ] && unset $vars',
21
+ "export ELECTRON_RUN_AS_NODE=1",
22
+ 'exec "$@"'
23
+ ].join("; ");
24
+ function wrapElectronAsNodeLaunch(file, args) {
25
+ if (process.platform === "win32") return { file, args };
26
+ return {
27
+ file: "/bin/sh",
28
+ args: ["-c", STRIP_NESTED_ELECTRON_THEN_EXEC, "sh", file, ...args]
29
+ };
30
+ }
31
+
32
+ export {
33
+ stripNestedElectronEnv,
34
+ dropNestedElectronEnvFromProcess,
35
+ wrapElectronAsNodeLaunch
36
+ };
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-VROPG6QF.js";
10
10
  import {
11
11
  isOrchestratorThread
12
- } from "./chunk-P5VDPGAN.js";
12
+ } from "./chunk-DJFGX4RT.js";
13
13
  import {
14
14
  enrichPathWithNpmGlobalBin,
15
15
  isConductorBundledCli,
@@ -21,8 +21,9 @@ import {
21
21
  claudeChromeEnabled,
22
22
  loadAppSettings,
23
23
  resolveAgentExecutable,
24
- resolveClaudeExecutable
25
- } from "./chunk-XKNBSYA7.js";
24
+ resolveClaudeExecutable,
25
+ wrapElectronAsNodeLaunch
26
+ } from "./chunk-UHGN4KCL.js";
26
27
  import {
27
28
  appDataDir
28
29
  } from "./chunk-7MV3RXSC.js";
@@ -588,6 +589,13 @@ function sideboardMcpProfile(env = process.env) {
588
589
  function isAsarPath(filePath) {
589
590
  return /\.asar([/\\]|$)/.test(filePath);
590
591
  }
592
+ function applyNodeLaunch(launch, args) {
593
+ if (!launch.env.ELECTRON_RUN_AS_NODE) {
594
+ return { file: launch.file, args, env: launch.env };
595
+ }
596
+ const wrapped = wrapElectronAsNodeLaunch(launch.file, args);
597
+ return { file: wrapped.file, args: wrapped.args, env: launch.env };
598
+ }
591
599
  async function resolveNodeLaunch(scriptPath) {
592
600
  if (isAsarPath(scriptPath)) {
593
601
  return {
@@ -748,11 +756,11 @@ async function resolveSideboardMcpServer() {
748
756
  if (entry) {
749
757
  const isCli = /[/\\]cli[/\\]dist[/\\]index\.js$/.test(entry);
750
758
  const scriptArgs = isCli ? [entry, "mcp"] : [entry];
751
- const launch = await resolveNodeLaunch(entry);
759
+ const launch = applyNodeLaunch(await resolveNodeLaunch(entry), scriptArgs);
752
760
  return {
753
761
  name: "sideboard",
754
762
  command: launch.file,
755
- args: scriptArgs,
763
+ args: launch.args,
756
764
  ...Object.keys(launch.env).length > 0 ? { env: launch.env } : {}
757
765
  };
758
766
  }
@@ -1045,7 +1053,7 @@ var claudeAdapter = {
1045
1053
  );
1046
1054
  }
1047
1055
  const mode = permissionMode(thread);
1048
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-NUMUJRWG.js");
1056
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-OBRWUPZG.js");
1049
1057
  const isOrchestrator = isOrchestratorThread2(thread);
1050
1058
  const injectedServers = await buildInjectedMcpServers({
1051
1059
  includeSideboard: true,
@@ -1867,10 +1875,13 @@ var cursorAdapter = {
1867
1875
  };
1868
1876
  const runner = cursorRunnerPath();
1869
1877
  const isTs = runner.endsWith(".ts");
1870
- const launch = await resolveNodeLaunch(runner);
1878
+ const launch = applyNodeLaunch(
1879
+ await resolveNodeLaunch(runner),
1880
+ isTs ? ["--import", "tsx", runner] : [runner]
1881
+ );
1871
1882
  return {
1872
1883
  file: launch.file,
1873
- args: isTs ? ["--import", "tsx", runner] : [runner],
1884
+ args: launch.args,
1874
1885
  cwd: thread.worktreePath,
1875
1886
  stdin: JSON.stringify(req),
1876
1887
  env: {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isOrchestratorThread
3
- } from "./chunk-6F2TQFJE.js";
3
+ } from "./chunk-NXXT5SE3.js";
4
4
  import {
5
5
  applyConnectedTeamToCli,
6
6
  brightsyMcpServerName,
@@ -19,7 +19,10 @@ import {
19
19
  loadAppSettings,
20
20
  resolveAgentExecutable,
21
21
  resolveClaudeExecutable
22
- } from "./chunk-IFPN6TER.js";
22
+ } from "./chunk-YO3CYL6B.js";
23
+ import {
24
+ wrapElectronAsNodeLaunch
25
+ } from "./chunk-IZ7RPF54.js";
23
26
  import {
24
27
  appDataDir
25
28
  } from "./chunk-M37RITA6.js";
@@ -528,6 +531,13 @@ function sideboardMcpProfile(env = process.env) {
528
531
  function isAsarPath(filePath) {
529
532
  return /\.asar([/\\]|$)/.test(filePath);
530
533
  }
534
+ function applyNodeLaunch(launch, args) {
535
+ if (!launch.env.ELECTRON_RUN_AS_NODE) {
536
+ return { file: launch.file, args, env: launch.env };
537
+ }
538
+ const wrapped = wrapElectronAsNodeLaunch(launch.file, args);
539
+ return { file: wrapped.file, args: wrapped.args, env: launch.env };
540
+ }
531
541
  async function resolveNodeLaunch(scriptPath) {
532
542
  if (isAsarPath(scriptPath)) {
533
543
  return {
@@ -692,11 +702,11 @@ async function resolveSideboardMcpServer() {
692
702
  if (entry) {
693
703
  const isCli = /[/\\]cli[/\\]dist[/\\]index\.js$/.test(entry);
694
704
  const scriptArgs = isCli ? [entry, "mcp"] : [entry];
695
- const launch = await resolveNodeLaunch(entry);
705
+ const launch = applyNodeLaunch(await resolveNodeLaunch(entry), scriptArgs);
696
706
  return {
697
707
  name: "sideboard",
698
708
  command: launch.file,
699
- args: scriptArgs,
709
+ args: launch.args,
700
710
  ...Object.keys(launch.env).length > 0 ? { env: launch.env } : {}
701
711
  };
702
712
  }
@@ -992,7 +1002,7 @@ var claudeAdapter = {
992
1002
  );
993
1003
  }
994
1004
  const mode = permissionMode(thread);
995
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-DZM4ZFGU.js");
1005
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-GSLCEB5E.js");
996
1006
  const isOrchestrator = isOrchestratorThread2(thread);
997
1007
  const injectedServers = await buildInjectedMcpServers({
998
1008
  includeSideboard: true,
@@ -1643,10 +1653,13 @@ var cursorAdapter = {
1643
1653
  };
1644
1654
  const runner = cursorRunnerPath();
1645
1655
  const isTs = runner.endsWith(".ts");
1646
- const launch = await resolveNodeLaunch(runner);
1656
+ const launch = applyNodeLaunch(
1657
+ await resolveNodeLaunch(runner),
1658
+ isTs ? ["--import", "tsx", runner] : [runner]
1659
+ );
1647
1660
  return {
1648
1661
  file: launch.file,
1649
- args: isTs ? ["--import", "tsx", runner] : [runner],
1662
+ args: launch.args,
1650
1663
  cwd: thread.worktreePath,
1651
1664
  stdin: JSON.stringify(req),
1652
1665
  env: {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  isGlobalRepoPath
3
- } from "./chunk-6F2TQFJE.js";
3
+ } from "./chunk-NXXT5SE3.js";
4
4
  import {
5
5
  ensureGhPreferOrigin,
6
6
  resolveRepoRoot
7
- } from "./chunk-YVVXWWCC.js";
7
+ } from "./chunk-GD2FM6FN.js";
8
8
  import {
9
9
  appDataDir
10
10
  } from "./chunk-M37RITA6.js";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  ensureGlobalCoordinatorCwd
3
- } from "./chunk-CQBQWX73.js";
3
+ } from "./chunk-E2MIA7DO.js";
4
4
  import {
5
5
  allocateTeamName,
6
6
  takenSlugsFromThread,
7
7
  teamSlugFromName
8
- } from "./chunk-YVVXWWCC.js";
8
+ } from "./chunk-GD2FM6FN.js";
9
9
  import {
10
10
  resolveNewThreadOptions,
11
11
  resolveThreadDefaults
12
- } from "./chunk-IFPN6TER.js";
12
+ } from "./chunk-YO3CYL6B.js";
13
13
  import {
14
14
  createEmptyThread,
15
15
  listThreads,
@@ -2,11 +2,11 @@
2
2
 
3
3
  import {
4
4
  isGlobalRepoPath
5
- } from "./chunk-P5VDPGAN.js";
5
+ } from "./chunk-DJFGX4RT.js";
6
6
  import {
7
7
  ensureGhPreferOrigin,
8
8
  resolveRepoRoot
9
- } from "./chunk-FUUVPN4A.js";
9
+ } from "./chunk-HBBXS2FR.js";
10
10
  import {
11
11
  appDataDir
12
12
  } from "./chunk-7MV3RXSC.js";
@@ -17,6 +17,37 @@ import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
17
17
  import { homedir, hostname } from "os";
18
18
  import { join as join2 } from "path";
19
19
 
20
+ // src/hook/nested-electron-env.ts
21
+ var NESTED_ELECTRON_ENV_PREFIXES = ["ELECTRON_", "CHROME_"];
22
+ function isNestedElectronEnvKey(key) {
23
+ return NESTED_ELECTRON_ENV_PREFIXES.some((prefix) => key.startsWith(prefix));
24
+ }
25
+ function stripNestedElectronEnv(env) {
26
+ const out = { ...env };
27
+ for (const key of Object.keys(out)) {
28
+ if (isNestedElectronEnvKey(key)) delete out[key];
29
+ }
30
+ return out;
31
+ }
32
+ function dropNestedElectronEnvFromProcess(env = process.env) {
33
+ for (const key of Object.keys(env)) {
34
+ if (isNestedElectronEnvKey(key)) delete env[key];
35
+ }
36
+ }
37
+ var STRIP_NESTED_ELECTRON_THEN_EXEC = [
38
+ "vars=`printenv | awk -F= '/^(ELECTRON_|CHROME_)/{print $1}'`",
39
+ '[ -n "$vars" ] && unset $vars',
40
+ "export ELECTRON_RUN_AS_NODE=1",
41
+ 'exec "$@"'
42
+ ].join("; ");
43
+ function wrapElectronAsNodeLaunch(file, args) {
44
+ if (process.platform === "win32") return { file, args };
45
+ return {
46
+ file: "/bin/sh",
47
+ args: ["-c", STRIP_NESTED_ELECTRON_THEN_EXEC, "sh", file, ...args]
48
+ };
49
+ }
50
+
20
51
  // src/store/secret-vault.ts
21
52
  import { join } from "path";
22
53
 
@@ -1062,7 +1093,7 @@ function applyAppEnvironment(target = process.env, settings = loadAppSettings())
1062
1093
  }
1063
1094
  function childEnvWithAppSettings(extra) {
1064
1095
  const settings = loadAppSettings();
1065
- const env = { ...process.env };
1096
+ const env = stripNestedElectronEnv({ ...process.env });
1066
1097
  applyAppEnvironment(env, settings);
1067
1098
  if (extra) {
1068
1099
  for (const [k, v] of Object.entries(extra)) {
@@ -1076,6 +1107,9 @@ function harnessEnvKey(harness) {
1076
1107
  }
1077
1108
 
1078
1109
  export {
1110
+ stripNestedElectronEnv,
1111
+ dropNestedElectronEnvFromProcess,
1112
+ wrapElectronAsNodeLaunch,
1079
1113
  resolveVaultKey,
1080
1114
  readSecureJson,
1081
1115
  writeSecureJson,
@@ -1,3 +1,6 @@
1
+ import {
2
+ stripNestedElectronEnv
3
+ } from "./chunk-IZ7RPF54.js";
1
4
  import {
2
5
  chmodOwnerOnly,
3
6
  writePrivateFile
@@ -1077,7 +1080,7 @@ function applyAppEnvironment(target = process.env, settings = loadAppSettings())
1077
1080
  }
1078
1081
  function childEnvWithAppSettings(extra) {
1079
1082
  const settings = loadAppSettings();
1080
- const env = { ...process.env };
1083
+ const env = stripNestedElectronEnv({ ...process.env });
1081
1084
  applyAppEnvironment(env, settings);
1082
1085
  if (extra) {
1083
1086
  for (const [k, v] of Object.entries(extra)) {
@@ -7,10 +7,11 @@ import {
7
7
  enrichWorkspacesWithGithub,
8
8
  ensureGlobalCoordinatorCwd,
9
9
  formatWorkspaceInventory
10
- } from "./chunk-CQBQWX73.js";
11
- import "./chunk-YVVXWWCC.js";
10
+ } from "./chunk-E2MIA7DO.js";
11
+ import "./chunk-GD2FM6FN.js";
12
12
  import "./chunk-FKOIHGKV.js";
13
- import "./chunk-IFPN6TER.js";
13
+ import "./chunk-YO3CYL6B.js";
14
+ import "./chunk-IZ7RPF54.js";
14
15
  import "./chunk-JT7R45JB.js";
15
16
  import "./chunk-FWJYLBO6.js";
16
17
  import "./chunk-77WWLBCI.js";
@@ -9,12 +9,12 @@ import {
9
9
  enrichWorkspacesWithGithub,
10
10
  ensureGlobalCoordinatorCwd,
11
11
  formatWorkspaceInventory
12
- } from "./chunk-4HJK57XU.js";
13
- import "./chunk-FUUVPN4A.js";
12
+ } from "./chunk-ERJS3ZDP.js";
13
+ import "./chunk-HBBXS2FR.js";
14
14
  import "./chunk-B3SJXYIJ.js";
15
15
  import "./chunk-7FD7COKE.js";
16
16
  import "./chunk-AE5VBOFE.js";
17
- import "./chunk-XKNBSYA7.js";
17
+ import "./chunk-UHGN4KCL.js";
18
18
  import "./chunk-NSTQ6QKD.js";
19
19
  import "./chunk-KGZBYWZ3.js";
20
20
  import "./chunk-7MV3RXSC.js";
@@ -14,11 +14,12 @@ import {
14
14
  orchestratorSessionPoisonedByBuiltins,
15
15
  slackCoordinatorSourceRef,
16
16
  takenTeamSlugsForOrchestration
17
- } from "./chunk-6F2TQFJE.js";
18
- import "./chunk-CQBQWX73.js";
19
- import "./chunk-YVVXWWCC.js";
17
+ } from "./chunk-NXXT5SE3.js";
18
+ import "./chunk-E2MIA7DO.js";
19
+ import "./chunk-GD2FM6FN.js";
20
20
  import "./chunk-FKOIHGKV.js";
21
- import "./chunk-IFPN6TER.js";
21
+ import "./chunk-YO3CYL6B.js";
22
+ import "./chunk-IZ7RPF54.js";
22
23
  import "./chunk-JT7R45JB.js";
23
24
  import "./chunk-FWJYLBO6.js";
24
25
  import "./chunk-77WWLBCI.js";
@@ -16,13 +16,13 @@ import {
16
16
  orchestratorSessionPoisonedByBuiltins,
17
17
  slackCoordinatorSourceRef,
18
18
  takenTeamSlugsForOrchestration
19
- } from "./chunk-P5VDPGAN.js";
20
- import "./chunk-4HJK57XU.js";
21
- import "./chunk-FUUVPN4A.js";
19
+ } from "./chunk-DJFGX4RT.js";
20
+ import "./chunk-ERJS3ZDP.js";
21
+ import "./chunk-HBBXS2FR.js";
22
22
  import "./chunk-B3SJXYIJ.js";
23
23
  import "./chunk-7FD7COKE.js";
24
24
  import "./chunk-AE5VBOFE.js";
25
- import "./chunk-XKNBSYA7.js";
25
+ import "./chunk-UHGN4KCL.js";
26
26
  import "./chunk-NSTQ6QKD.js";
27
27
  import "./chunk-KGZBYWZ3.js";
28
28
  import {