@sideboard-ai/core 0.1.232 → 0.1.233

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 (42) hide show
  1. package/dist/agents/cursor-runner.cjs +167 -62
  2. package/dist/agents/cursor-runner.js +16 -9
  3. package/dist/{agents-ENAQHQRZ.js → agents-J2CUJHPC.js} +16 -6
  4. package/dist/{agents-TCTEAK6M.js → agents-LDYMFW6N.js} +17 -7
  5. package/dist/{chunk-TQBUXKIB.js → chunk-26T43LBM.js} +97 -11
  6. package/dist/{chunk-PO4M4JAJ.js → chunk-2P4XKWV2.js} +1 -1
  7. package/dist/{chunk-ABOBTSO6.js → chunk-2UG25RMK.js} +18 -5
  8. package/dist/{chunk-4CZ25DO2.js → chunk-4VFOJZPS.js} +2 -2
  9. package/dist/{chunk-N5TX66CD.js → chunk-7H2CVVLF.js} +2 -2
  10. package/dist/{chunk-LLMG6OVS.js → chunk-BGHDWCAV.js} +19 -19
  11. package/dist/{chunk-SZJZEFTY.js → chunk-DD67JWTN.js} +1 -1
  12. package/dist/{chunk-7BZ7DSBN.js → chunk-NLETJP7Z.js} +17 -17
  13. package/dist/{chunk-FA4CPYCY.js → chunk-PZQNE5X4.js} +81 -41
  14. package/dist/{chunk-HVUVQXZ2.js → chunk-QVN2WOKJ.js} +18 -5
  15. package/dist/{chunk-HZFLKVGC.js → chunk-S2OEFXST.js} +1 -1
  16. package/dist/{chunk-SXFRXNBM.js → chunk-SPAMHHJH.js} +1 -1
  17. package/dist/{chunk-ZXJMAKEP.js → chunk-TNVJPFHM.js} +5 -5
  18. package/dist/{chunk-UNTOZA3C.js → chunk-TWXSZYR2.js} +1 -1
  19. package/dist/{chunk-6L25K7BE.js → chunk-TXMFBL3X.js} +195 -73
  20. package/dist/{connected-teams-PIBQTOJU.js → connected-teams-JUJAQZZE.js} +2 -2
  21. package/dist/{connected-teams-RVD3PFAG.js → connected-teams-KQUDU7LZ.js} +2 -2
  22. package/dist/{coordinator-prompt-YKLXQTWH.js → coordinator-prompt-CE7MN6QY.js} +4 -4
  23. package/dist/{coordinator-prompt-DFXYTM6D.js → coordinator-prompt-IGDMFKCD.js} +4 -4
  24. package/dist/{global-workspace-EYZKYHAO.js → global-workspace-7WH24UFO.js} +4 -4
  25. package/dist/{global-workspace-4SPANNJT.js → global-workspace-NCIC2Y2U.js} +4 -4
  26. package/dist/index.cjs +490 -326
  27. package/dist/index.d.cts +19 -3
  28. package/dist/index.d.ts +19 -3
  29. package/dist/index.js +27 -8
  30. package/dist/mcp/run-stdio.cjs +418 -302
  31. package/dist/mcp/run-stdio.js +7 -7
  32. package/dist/{orchestrator-FTHJKPIX.js → orchestrator-BXALNM4M.js} +8 -8
  33. package/dist/{orchestrator-RJX4OKYC.js → orchestrator-NLZMHTLX.js} +7 -7
  34. package/dist/{run-UEQM4JMZ.js → run-PCX5QWR4.js} +1 -1
  35. package/dist/{run-QDZCTP4Y.js → run-TB7RBII2.js} +1 -1
  36. package/dist/{workspaces-73Y7IJY2.js → workspaces-H2TRFDE2.js} +4 -4
  37. package/dist/{workspaces-FQCSCTNH.js → workspaces-NSQZSDQD.js} +4 -4
  38. package/dist/{worktree-DOPRKG7K.js → worktree-FMIX4BRV.js} +3 -3
  39. package/dist/{worktree-36VEFUJN.js → worktree-W7BSI4GU.js} +3 -3
  40. package/dist/{worktree-exclude-K7QK4RI5.js → worktree-exclude-5N2KTYIT.js} +2 -2
  41. package/dist/{worktree-exclude-L32WEBX6.js → worktree-exclude-RXZPTCNH.js} +2 -2
  42. package/package.json +2 -2
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  isOrchestratorThread
3
- } from "./chunk-HZFLKVGC.js";
3
+ } from "./chunk-S2OEFXST.js";
4
4
  import {
5
5
  codexUnattendedGitConfigArgs,
6
6
  mergeAgentGitAuthEnv,
7
7
  resolveAgentGitAuthEnv,
8
8
  resolveCodexGitWritableRoots
9
- } from "./chunk-N5TX66CD.js";
9
+ } from "./chunk-7H2CVVLF.js";
10
10
  import {
11
11
  applyConnectedTeamToCli,
12
12
  brightsyMcpServerName,
13
13
  ensureCliTeamTracked,
14
14
  ensureConnectedBrightsyTeamTokens
15
- } from "./chunk-ZXJMAKEP.js";
15
+ } from "./chunk-TNVJPFHM.js";
16
16
  import {
17
17
  loadBrightsyConfig
18
18
  } from "./chunk-ROPGQRPU.js";
@@ -20,20 +20,23 @@ import {
20
20
  httpFetch
21
21
  } from "./chunk-N7WZ6NIN.js";
22
22
  import {
23
+ CURSOR_SDK_INSTALL_HINT,
23
24
  applyAgentRunnerHeapEnv,
24
25
  applyNodeLaunch,
25
26
  clipToolResultForStore,
26
27
  cursorRipgrepEnv,
27
28
  extractJsonErrorMessage,
28
29
  formatUnknownDetail,
30
+ importCursorSdk,
29
31
  isAsarPath,
32
+ isCursorSdkInstalled,
30
33
  looksLikeAgentFailureMessage,
31
34
  looksLikeBrightsyEmptyCompletion,
32
35
  packagedCursorRunnerPath,
33
36
  packagedMcpStdioPath,
34
37
  parseCursorRunnerLine,
35
38
  resolveNodeLaunch
36
- } from "./chunk-TQBUXKIB.js";
39
+ } from "./chunk-26T43LBM.js";
37
40
  import {
38
41
  claudeChromeEnabled,
39
42
  fromInclusiveInputUsage,
@@ -52,7 +55,7 @@ import {
52
55
  resolveCommandBinarySync,
53
56
  run,
54
57
  withExportedPath
55
- } from "./chunk-HVUVQXZ2.js";
58
+ } from "./chunk-QVN2WOKJ.js";
56
59
  import {
57
60
  isElectronLikeCommand,
58
61
  unwrapStrippedElectronLaunch
@@ -2117,7 +2120,7 @@ var claudeAdapter = {
2117
2120
  );
2118
2121
  }
2119
2122
  const mode = permissionMode(thread);
2120
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-4SPANNJT.js");
2123
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-NCIC2Y2U.js");
2121
2124
  const isOrchestrator = isOrchestratorThread2(thread);
2122
2125
  const injectedServers = await buildInjectedMcpServers({
2123
2126
  includeSideboard: true,
@@ -2734,7 +2737,6 @@ import { existsSync as existsSync7 } from "fs";
2734
2737
  import { createRequire as createRequire2 } from "module";
2735
2738
  import { dirname as dirname3, join as join5 } from "path";
2736
2739
  import { fileURLToPath as fileURLToPath2 } from "url";
2737
- import { Cursor } from "@cursor/sdk";
2738
2740
  var FALLBACK_CURSOR_MODELS = [
2739
2741
  { id: "default", displayName: "Auto" },
2740
2742
  { id: "composer-2.5", displayName: "Composer 2.5" },
@@ -2765,8 +2767,10 @@ async function listCursorModels() {
2765
2767
  }
2766
2768
  const apiKey = resolveCursorApiKey();
2767
2769
  if (!apiKey) return FALLBACK_CURSOR_MODELS;
2770
+ const sdk = await importCursorSdk();
2771
+ if (!sdk) return FALLBACK_CURSOR_MODELS;
2768
2772
  try {
2769
- const listed = await Cursor.models.list({ apiKey });
2773
+ const listed = await sdk.Cursor.models.list({ apiKey });
2770
2774
  const models = listed.map((m) => ({
2771
2775
  id: m.id,
2772
2776
  displayName: m.displayName || m.id,
@@ -2815,6 +2819,16 @@ function cursorRunnerPath() {
2815
2819
  var cursorAdapter = {
2816
2820
  kind: "cursor",
2817
2821
  async detect() {
2822
+ if (!isCursorSdkInstalled()) {
2823
+ return {
2824
+ agent: "cursor",
2825
+ installed: false,
2826
+ authenticated: false,
2827
+ linearMcp: false,
2828
+ warnings: [],
2829
+ reason: CURSOR_SDK_INSTALL_HINT
2830
+ };
2831
+ }
2818
2832
  const apiKey = resolveCursorApiKey();
2819
2833
  if (!apiKey) {
2820
2834
  return {
@@ -3810,6 +3824,7 @@ async function getClaudePlanUsage(opts = {}) {
3810
3824
  }
3811
3825
 
3812
3826
  // src/agents/install.ts
3827
+ import { existsSync as existsSync10 } from "fs";
3813
3828
  var SETUP = {
3814
3829
  claude: {
3815
3830
  agent: "claude",
@@ -3818,7 +3833,8 @@ var SETUP = {
3818
3833
  docsUrl: "https://code.claude.com/docs/en/install",
3819
3834
  installCommand: "npm install -g @anthropic-ai/claude-code",
3820
3835
  loginCommand: "claude auth login",
3821
- npmPackage: "@anthropic-ai/claude-code"
3836
+ npmPackage: "@anthropic-ai/claude-code",
3837
+ updateArgs: ["update"]
3822
3838
  },
3823
3839
  codex: {
3824
3840
  agent: "codex",
@@ -3827,7 +3843,8 @@ var SETUP = {
3827
3843
  docsUrl: "https://github.com/openai/codex",
3828
3844
  installCommand: "npm install -g @openai/codex",
3829
3845
  loginCommand: "codex login",
3830
- npmPackage: "@openai/codex"
3846
+ npmPackage: "@openai/codex",
3847
+ updateArgs: ["update"]
3831
3848
  },
3832
3849
  opencode: {
3833
3850
  agent: "opencode",
@@ -3837,20 +3854,22 @@ var SETUP = {
3837
3854
  // Prefer the official installer; npm package name is opencode-ai.
3838
3855
  installCommand: "curl -fsSL https://opencode.ai/install | bash",
3839
3856
  loginCommand: "opencode auth login",
3840
- npmPackage: "opencode-ai@latest"
3857
+ npmPackage: "opencode-ai@latest",
3858
+ updateArgs: ["upgrade"]
3841
3859
  },
3842
3860
  cursor: {
3843
3861
  agent: "cursor",
3844
- kind: "bundled-sdk",
3845
- summary: "No CLI install \u2014 Sideboard ships the Cursor SDK. Add a CURSOR_API_KEY from the Cursor dashboard.",
3846
- docsUrl: "https://cursor.com/dashboard/integrations",
3847
- installCommand: null,
3848
- loginCommand: null
3862
+ kind: "cli",
3863
+ summary: "Install (or update) @cursor/sdk with npm \u2014 Sideboard does not pin it in the app. Then add a CURSOR_API_KEY.",
3864
+ docsUrl: "https://www.npmjs.com/package/@cursor/sdk",
3865
+ installCommand: "npm install -g @cursor/sdk",
3866
+ loginCommand: null,
3867
+ npmPackage: "@cursor/sdk"
3849
3868
  },
3850
3869
  brightsy: {
3851
3870
  agent: "brightsy",
3852
3871
  kind: "cli",
3853
- summary: "Install the Brightsy CLI, then run `brightsy login`.",
3872
+ summary: "Install (or update) the Brightsy CLI with npm, then run `brightsy login`.",
3854
3873
  docsUrl: "https://www.npmjs.com/package/@brightsy/cli",
3855
3874
  installCommand: "npm install -g @brightsy/cli",
3856
3875
  loginCommand: "brightsy login",
@@ -3946,16 +3965,6 @@ async function whichOnPath(bin) {
3946
3965
  }
3947
3966
  async function installNpmGlobalPackage(opts) {
3948
3967
  enrichPathWithNpmGlobalBin();
3949
- if (opts.cliBin) {
3950
- const existing = await whichOnPath(opts.cliBin);
3951
- if (existing) {
3952
- return {
3953
- ok: true,
3954
- command: existing,
3955
- message: isConductorBundledCli(existing) ? `Using Conductor\u2019s ${opts.cliBin} at ${existing}. No extra install \u2014 Log in only if auth is missing.` : `Already on PATH: ${existing}`
3956
- };
3957
- }
3958
- }
3959
3968
  const result = await run("npm", ["install", "-g", opts.npmPackage], { reject: false });
3960
3969
  const ok = result.exitCode === 0;
3961
3970
  if (!ok) {
@@ -3992,6 +4001,33 @@ async function installNpmGlobalPackage(opts) {
3992
4001
  message: binPath ? `Installed ${opts.npmPackage} \u2192 ${binPath}` : `Installed ${opts.npmPackage} (CLI not yet on PATH)`
3993
4002
  };
3994
4003
  }
4004
+ async function resolveExistingCli(agent) {
4005
+ if (agent === "cursor") return null;
4006
+ const exe = resolveAgentExecutable(agent);
4007
+ if ((exe.includes("/") || exe.includes("\\")) && existsSync10(exe)) return exe;
4008
+ enrichPathWithNpmGlobalBin();
4009
+ return whichOnPath(CLI_BIN[agent]);
4010
+ }
4011
+ async function runVendorUpdate(existing, updateArgs) {
4012
+ const result = await run(existing, updateArgs, {
4013
+ reject: false,
4014
+ timeoutMs: 12e4
4015
+ });
4016
+ const command = `${existing} ${updateArgs.join(" ")}`;
4017
+ const ok = result.exitCode === 0;
4018
+ const detail = result.stdout.trim() || result.stderr.trim() || `exit ${result.exitCode}`;
4019
+ return {
4020
+ ok,
4021
+ command,
4022
+ exitCode: result.exitCode,
4023
+ stdout: result.stdout,
4024
+ stderr: result.stderr,
4025
+ message: ok ? isConductorBundledCli(existing) ? `Updated Conductor\u2019s CLI at ${existing}. ${detail}` : `Updated ${command}. ${detail}` : `Update failed (${command}): ${detail}`
4026
+ };
4027
+ }
4028
+ function isCurlInstaller(command) {
4029
+ return /curl\s| \|\s*bash/.test(command);
4030
+ }
3995
4031
  async function installAgent(agent) {
3996
4032
  const info = getAgentSetupInfo(agent);
3997
4033
  if (info.kind === "bundled-sdk" || info.kind === "api-key") {
@@ -4003,21 +4039,25 @@ async function installAgent(agent) {
4003
4039
  if (!info.installCommand) {
4004
4040
  return { ok: false, message: `No install command for ${agent}` };
4005
4041
  }
4006
- if (/curl\s| \|\s*bash/.test(info.installCommand) || !info.npmPackage) {
4007
- await openInSystemTerminal(info.installCommand);
4008
- return {
4009
- ok: true,
4010
- openedTerminal: true,
4011
- command: info.installCommand,
4012
- message: `Opened Terminal to run: ${info.installCommand}`
4013
- };
4042
+ const existing = await resolveExistingCli(agent);
4043
+ if (existing && info.updateArgs?.length) {
4044
+ return runVendorUpdate(existing, info.updateArgs);
4014
4045
  }
4015
- const cliBin = agent === "cursor" ? null : CLI_BIN[agent];
4016
- return installNpmGlobalPackage({
4017
- npmPackage: info.npmPackage,
4018
- installCommand: info.installCommand,
4019
- cliBin
4020
- });
4046
+ if (info.npmPackage && !isCurlInstaller(info.installCommand)) {
4047
+ const cliBin = agent === "cursor" ? null : CLI_BIN[agent];
4048
+ return installNpmGlobalPackage({
4049
+ npmPackage: info.npmPackage,
4050
+ installCommand: info.installCommand,
4051
+ cliBin
4052
+ });
4053
+ }
4054
+ await openInSystemTerminal(info.installCommand);
4055
+ return {
4056
+ ok: true,
4057
+ openedTerminal: true,
4058
+ command: info.installCommand,
4059
+ message: `Opened Terminal to run: ${info.installCommand}`
4060
+ };
4021
4061
  }
4022
4062
  async function loginAgent(agent) {
4023
4063
  const info = getAgentSetupInfo(agent);
@@ -63,6 +63,14 @@ function ensureAgentPath(env = process.env) {
63
63
  }
64
64
  function enrichPathWithNpmGlobalBin(env = process.env) {
65
65
  ensureAgentPath(env);
66
+ const prefix = npmGlobalPrefix(env);
67
+ if (prefix) {
68
+ const binDir = process.platform === "win32" ? prefix : join(prefix, "bin");
69
+ prependPathDir(env, binDir);
70
+ }
71
+ return env.PATH ?? "";
72
+ }
73
+ function npmGlobalPrefix(env = process.env) {
66
74
  try {
67
75
  const prefix = execFileSync("npm", ["prefix", "-g"], {
68
76
  encoding: "utf8",
@@ -70,13 +78,16 @@ function enrichPathWithNpmGlobalBin(env = process.env) {
70
78
  timeout: 8e3,
71
79
  stdio: ["ignore", "pipe", "ignore"]
72
80
  }).trim().split(/\r?\n/).find(Boolean);
73
- if (prefix) {
74
- const binDir = process.platform === "win32" ? prefix : join(prefix, "bin");
75
- prependPathDir(env, binDir);
76
- }
81
+ return prefix || null;
77
82
  } catch {
83
+ return null;
78
84
  }
79
- return env.PATH ?? "";
85
+ }
86
+ function npmGlobalNodeModules(env = process.env) {
87
+ const prefix = npmGlobalPrefix(env);
88
+ if (!prefix) return null;
89
+ const dir = process.platform === "win32" ? join(prefix, "node_modules") : join(prefix, "lib", "node_modules");
90
+ return existsSync(dir) ? dir : null;
80
91
  }
81
92
  function posixShellSingleQuote(value) {
82
93
  return `'${value.replace(/'/g, `'\\''`)}'`;
@@ -307,6 +318,8 @@ export {
307
318
  isConductorBundledCli,
308
319
  ensureAgentPath,
309
320
  enrichPathWithNpmGlobalBin,
321
+ npmGlobalPrefix,
322
+ npmGlobalNodeModules,
310
323
  posixShellSingleQuote,
311
324
  resolveCommandBinarySync,
312
325
  withExportedPath,
@@ -6,7 +6,7 @@ import {
6
6
  resolveRepoRoot,
7
7
  takenSlugsFromThread,
8
8
  teamSlugFromName
9
- } from "./chunk-N5TX66CD.js";
9
+ } from "./chunk-7H2CVVLF.js";
10
10
  import {
11
11
  ATTACHMENTS_DIR,
12
12
  attachmentsGitignoreBody
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-P2BSMNHB.js";
11
11
  import {
12
12
  run
13
- } from "./chunk-ABOBTSO6.js";
13
+ } from "./chunk-2UG25RMK.js";
14
14
  import {
15
15
  appDataDir
16
16
  } from "./chunk-EQNRWDLN.js";
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-WFUDY6PC.js";
12
12
  import {
13
13
  run
14
- } from "./chunk-HVUVQXZ2.js";
14
+ } from "./chunk-QVN2WOKJ.js";
15
15
 
16
16
  // src/brightsy/connected-teams.ts
17
17
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -19,7 +19,7 @@ import { join } from "path";
19
19
 
20
20
  // src/brightsy/accounts.ts
21
21
  async function loadConnectedTeams() {
22
- const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-PIBQTOJU.js");
22
+ const { listConnectedBrightsyTeams: listConnectedBrightsyTeams2 } = await import("./connected-teams-JUJAQZZE.js");
23
23
  return listConnectedBrightsyTeams2();
24
24
  }
25
25
  async function runBrightsyTeamsJson(args) {
@@ -48,14 +48,14 @@ async function listBrightsyAccounts() {
48
48
  async function getBrightsySession() {
49
49
  try {
50
50
  const { ensureBrightsyLocalConfigFresh: ensureBrightsyLocalConfigFresh2 } = await import("./oauth-S3M7B475.js");
51
- const { ensureConnectedBrightsyTeamTokens: ensureConnectedBrightsyTeamTokens2 } = await import("./connected-teams-PIBQTOJU.js");
51
+ const { ensureConnectedBrightsyTeamTokens: ensureConnectedBrightsyTeamTokens2 } = await import("./connected-teams-JUJAQZZE.js");
52
52
  await ensureBrightsyLocalConfigFresh2();
53
53
  await ensureConnectedBrightsyTeamTokens2();
54
54
  loadBrightsyConfig();
55
55
  const data = await runBrightsyTeamsJson([]);
56
56
  const accounts = Array.isArray(data.teams) ? data.teams : [];
57
57
  const active = data.active ?? accounts.find((a) => a.active) ?? null;
58
- const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-PIBQTOJU.js");
58
+ const { ensureCliTeamTracked: ensureCliTeamTracked2 } = await import("./connected-teams-JUJAQZZE.js");
59
59
  const connectedTeams = ensureCliTeamTracked2(
60
60
  active ? { id: active.id, slug: active.slug, name: active.name } : void 0
61
61
  );
@@ -95,7 +95,7 @@ async function performBrightsyAccountSwitch(accountIdOrSlug) {
95
95
  return { cfg, target: data.active };
96
96
  }
97
97
  async function switchBrightsyAccount(accountIdOrSlug) {
98
- const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-PIBQTOJU.js");
98
+ const { connectBrightsyTeam: connectBrightsyTeam2 } = await import("./connected-teams-JUJAQZZE.js");
99
99
  await connectBrightsyTeam2(accountIdOrSlug);
100
100
  return getBrightsySession();
101
101
  }
@@ -8,7 +8,7 @@ import {
8
8
  resolveRepoRoot,
9
9
  takenSlugsFromThread,
10
10
  teamSlugFromName
11
- } from "./chunk-4CZ25DO2.js";
11
+ } from "./chunk-4VFOJZPS.js";
12
12
  import {
13
13
  ATTACHMENTS_DIR,
14
14
  attachmentsGitignoreBody