@sideboard-ai/core 0.1.57 → 0.1.59

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 (39) hide show
  1. package/dist/{agents-2YYWW723.js → agents-B2723EOF.js} +4 -4
  2. package/dist/{agents-AQFEFKBL.js → agents-EADRAAPG.js} +4 -4
  3. package/dist/{app-settings-2LQNRTBE.js → app-settings-TBHTJWLQ.js} +1 -1
  4. package/dist/{app-settings-73DI4B6T.js → app-settings-YBNZ4XSR.js} +1 -1
  5. package/dist/{chunk-5DMYULLC.js → chunk-2P2UK7E7.js} +2 -2
  6. package/dist/{chunk-7LNGIP3X.js → chunk-73AT5K4A.js} +15 -3
  7. package/dist/{chunk-DIOF73S2.js → chunk-75QR74KM.js} +7 -2
  8. package/dist/{chunk-EBWEKG52.js → chunk-CHGOMFTA.js} +3 -3
  9. package/dist/{chunk-C4BCC5X5.js → chunk-FGNBTFRD.js} +7 -2
  10. package/dist/{chunk-H6GGDLYS.js → chunk-JB2H7E7V.js} +1 -1
  11. package/dist/{chunk-BXJ76RHF.js → chunk-MBAL5FE6.js} +4 -4
  12. package/dist/{chunk-XOU6HNQJ.js → chunk-MFGGIRUA.js} +39 -13
  13. package/dist/{chunk-S42XDFKF.js → chunk-MLAST5BB.js} +3 -3
  14. package/dist/{chunk-C3J4GDW4.js → chunk-MX7UH5AT.js} +76 -60
  15. package/dist/{chunk-DQJ5D42H.js → chunk-NTYRBRE7.js} +44 -13
  16. package/dist/{chunk-DZFH2KLT.js → chunk-P7EQUFB6.js} +39 -13
  17. package/dist/{chunk-V2DUTUNC.js → chunk-QJBC4BRK.js} +2 -2
  18. package/dist/{chunk-ZNM4MAN4.js → chunk-RIWUU7FO.js} +15 -3
  19. package/dist/{chunk-UA5NDAHL.js → chunk-XWPKLRB3.js} +44 -13
  20. package/dist/{chunk-7F454EE2.js → chunk-ZXDOI6IH.js} +76 -53
  21. package/dist/{connected-teams-ONC4666A.js → connected-teams-MKIYKOYA.js} +2 -2
  22. package/dist/{connected-teams-2ANNZCP5.js → connected-teams-RSL4VB3X.js} +2 -2
  23. package/dist/{coordinator-prompt-RBKUNRPR.js → coordinator-prompt-4P23VVFC.js} +4 -4
  24. package/dist/{coordinator-prompt-ICF36NUQ.js → coordinator-prompt-LNWHZ64D.js} +4 -4
  25. package/dist/{global-workspace-667XLBW6.js → global-workspace-BHT4XUAA.js} +5 -5
  26. package/dist/{global-workspace-S7VLWPWG.js → global-workspace-TMMAVRVW.js} +5 -5
  27. package/dist/index.cjs +303 -115
  28. package/dist/index.d.cts +15 -6
  29. package/dist/index.d.ts +15 -6
  30. package/dist/index.js +157 -64
  31. package/dist/mcp/run-stdio.cjs +303 -126
  32. package/dist/mcp/run-stdio.js +156 -68
  33. package/dist/{run-ZJKYHXGN.js → run-GPSVV5OH.js} +1 -1
  34. package/dist/{run-H3IMNOYN.js → run-HZTBWGQR.js} +1 -1
  35. package/dist/{workspaces-FPJJXXAE.js → workspaces-3GO3EDQG.js} +6 -6
  36. package/dist/{workspaces-LYIDE2VR.js → workspaces-GFPGDGCS.js} +6 -6
  37. package/dist/{worktree-5KEQWSAF.js → worktree-3L2G6PCM.js} +2 -2
  38. package/dist/{worktree-RWGL7FUV.js → worktree-GBLHEFHR.js} +2 -2
  39. package/package.json +1 -1
@@ -4,7 +4,7 @@ import {
4
4
  ensureCliTeamTracked,
5
5
  ensureConnectedBrightsyTeamTokens,
6
6
  loadBrightsyConfig
7
- } from "./chunk-BXJ76RHF.js";
7
+ } from "./chunk-MBAL5FE6.js";
8
8
  import {
9
9
  extractJsonErrorMessage,
10
10
  formatUnknownDetail,
@@ -15,11 +15,14 @@ import {
15
15
  claudeChromeEnabled,
16
16
  loadAppSettings,
17
17
  resolveClaudeExecutable
18
- } from "./chunk-DIOF73S2.js";
18
+ } from "./chunk-75QR74KM.js";
19
+ import {
20
+ appDataDir
21
+ } from "./chunk-M37RITA6.js";
19
22
  import {
20
23
  ensureAgentPath,
21
24
  run
22
- } from "./chunk-7LNGIP3X.js";
25
+ } from "./chunk-73AT5K4A.js";
23
26
 
24
27
  // src/agents/brightsy-targets.ts
25
28
  function encodeBrightsyTarget(type, id, accountId) {
@@ -580,7 +583,16 @@ async function resolveSideboardMcpServer() {
580
583
  async function buildInjectedMcpServers(opts) {
581
584
  const servers = [];
582
585
  if (opts.includeSideboard) {
583
- servers.push(await resolveSideboardMcpServer());
586
+ const sideboard = await resolveSideboardMcpServer();
587
+ sideboard.env = {
588
+ ...sideboard.env ?? {},
589
+ SIDEBOARD_APP_DATA: appDataDir()
590
+ };
591
+ const orchId = opts.orchestratorThreadId?.trim();
592
+ if (orchId) {
593
+ sideboard.env.SIDEBOARD_ORCHESTRATOR_THREAD_ID = orchId;
594
+ }
595
+ servers.push(sideboard);
584
596
  }
585
597
  if (opts.includeBrightsy && isBrightsyConnected()) {
586
598
  const cmd = await resolveBrightsyMcpCommand();
@@ -624,6 +636,8 @@ function toCodexMcpConfigArgs(servers) {
624
636
  }
625
637
  }
626
638
  args.push("-c", `${prefix}.default_tools_approval_mode=${JSON.stringify("approve")}`);
639
+ args.push("-c", `${prefix}.tool_timeout_sec=300`);
640
+ args.push("-c", `${prefix}.startup_timeout_sec=30`);
627
641
  }
628
642
  return args;
629
643
  }
@@ -661,6 +675,16 @@ async function writeInjectedMcpConfig(opts) {
661
675
  // src/agents/types.ts
662
676
  var PLAN_MODE_INSTRUCTION = "Plan mode is active and must remain active until the user turns Plan mode off in the UI (or Approves / Hands off the plan). Analyze the codebase, search and read files as needed, and produce or refine a clear implementation plan. Do not modify, create, or delete any project files except via Sideboard MCP present_plan (writes .context/attachments/plan.md). When you need a clarifying decision (approach forks, auth choice, scope): (1) first write a short chat message that explains the decision and what each option means (tradeoffs, when to pick it) \u2014 do not leave the user staring at bare labels; (2) then call Sideboard MCP ask_user with the same options, including a description on every option. Sideboard shows questions in the composer and mirrors them in chat. After ask_user, wait for the user's next message with their answers before finalizing the plan. When the plan is ready for approval: (1) call present_plan with the full markdown plan (title + content) so Sideboard saves .context/attachments/plan.md and shows it in chat for Approve / Hand off / Copy; (2) Claude should also call ExitPlanMode after present_plan. Do not skip present_plan \u2014 the plan must be a markdown file, not only chat prose.";
663
677
  function permissionMode(thread) {
678
+ if (thread.sourceType === "orchestration") {
679
+ return {
680
+ claude: "acceptEdits",
681
+ opencodePermission: JSON.stringify({
682
+ edit: "allow",
683
+ bash: { "*": "allow", "rm -rf *": "deny" }
684
+ }),
685
+ codexSandbox: "danger-full-access"
686
+ };
687
+ }
664
688
  if (thread.planMode) {
665
689
  return {
666
690
  claude: "plan",
@@ -812,18 +836,17 @@ var claudeAdapter = {
812
836
  };
813
837
  }
814
838
  }
815
- const auth = await run(claude, ["auth", "status"], { reject: false });
839
+ const auth = await run(claude, ["auth", "status"], {
840
+ reject: false,
841
+ timeoutMs: 5e3
842
+ });
816
843
  const authenticated = auth.exitCode === 0;
817
- const servers = await loadMcpServers();
818
- const linearMcp = servers.some(
819
- (s) => s.connected && /linear/i.test(s.name)
820
- );
821
844
  return {
822
845
  agent: "claude",
823
846
  installed: true,
824
847
  authenticated,
825
- linearMcp,
826
- warnings: mcpAuthWarnings(servers),
848
+ linearMcp: false,
849
+ warnings: [],
827
850
  reason: authenticated ? void 0 : "claude auth status failed \u2014 run `claude auth login`"
828
851
  };
829
852
  },
@@ -840,11 +863,12 @@ var claudeAdapter = {
840
863
  );
841
864
  }
842
865
  const mode = permissionMode(thread);
843
- const { isOrchestratorThread } = await import("./global-workspace-S7VLWPWG.js");
866
+ const { isOrchestratorThread } = await import("./global-workspace-TMMAVRVW.js");
844
867
  const isOrchestrator = isOrchestratorThread(thread);
845
868
  const injectedServers = await buildInjectedMcpServers({
846
869
  includeSideboard: true,
847
- includeBrightsy: isBrightsyConnected()
870
+ includeBrightsy: isBrightsyConnected(),
871
+ orchestratorThreadId: isOrchestrator ? thread.id : null
848
872
  });
849
873
  const injectedBrightsyNames = injectedServers.filter((s) => s.name === "brightsy" || s.name.startsWith("brightsy_")).map((s) => s.name);
850
874
  const chromeOn = claudeChromeEnabled();
@@ -1035,7 +1059,7 @@ function parseIssuesJson(raw) {
1035
1059
  }
1036
1060
 
1037
1061
  // src/agents/codex.ts
1038
- import { existsSync as existsSync3, readFileSync } from "fs";
1062
+ import { existsSync as existsSync3, readFileSync, statSync } from "fs";
1039
1063
  import { homedir } from "os";
1040
1064
  import { join as join2 } from "path";
1041
1065
  var CODEX_PROMPT_ARG_MAX = 2e5;
@@ -1126,10 +1150,19 @@ function asRecord(value) {
1126
1150
  }
1127
1151
  return void 0;
1128
1152
  }
1153
+ function codexLooksAuthenticated() {
1154
+ const authPath = join2(homedir(), ".codex", "auth.json");
1155
+ if (!existsSync3(authPath)) return false;
1156
+ try {
1157
+ return statSync(authPath).size > 2;
1158
+ } catch {
1159
+ return false;
1160
+ }
1161
+ }
1129
1162
  var codexAdapter = {
1130
1163
  kind: "codex",
1131
1164
  async detect() {
1132
- const which = await run("which", ["codex"], { reject: false });
1165
+ const which = await run("which", ["codex"], { reject: false, timeoutMs: 3e3 });
1133
1166
  if (which.exitCode !== 0) {
1134
1167
  return {
1135
1168
  agent: "codex",
@@ -1140,10 +1173,8 @@ var codexAdapter = {
1140
1173
  reason: "codex CLI not found on PATH"
1141
1174
  };
1142
1175
  }
1143
- const auth = await run("codex", ["login", "status"], { reject: false });
1144
- const authenticated = auth.exitCode === 0;
1145
- const mcp = await run("codex", ["mcp", "list", "--json"], { reject: false });
1146
- const linearMcp = /linear/i.test(mcp.stdout + mcp.stderr);
1176
+ const authenticated = codexLooksAuthenticated();
1177
+ const linearMcp = false;
1147
1178
  const warnings = [];
1148
1179
  if (!codexConfigHasNetworkAccess()) {
1149
1180
  warnings.push(
@@ -1156,7 +1187,7 @@ var codexAdapter = {
1156
1187
  authenticated,
1157
1188
  linearMcp,
1158
1189
  warnings,
1159
- reason: authenticated ? void 0 : "codex login status failed \u2014 run `codex login`"
1190
+ reason: authenticated ? void 0 : "Codex auth not found \u2014 run `codex login` (expected ~/.codex/auth.json)"
1160
1191
  };
1161
1192
  },
1162
1193
  async buildTurn(thread, input) {
@@ -1174,23 +1205,26 @@ var codexAdapter = {
1174
1205
  const model = thread.model?.trim();
1175
1206
  const injected = await buildInjectedMcpServers({
1176
1207
  includeSideboard: true,
1177
- includeBrightsy: isBrightsyConnected()
1208
+ includeBrightsy: isBrightsyConnected(),
1209
+ orchestratorThreadId: thread.sourceType === "orchestration" ? thread.id : null
1178
1210
  });
1179
1211
  const mcpOverrides = toCodexMcpConfigArgs(injected);
1180
- const args = [
1181
- "exec",
1182
- ...sessionId ? ["resume", sessionId] : [],
1183
- promptArg,
1212
+ const execOpts = [
1213
+ // Global orchestration cwd is not a git repo; without this Codex ≥0.147
1214
+ // refuses to start ("Not inside a trusted directory").
1215
+ "--skip-git-repo-check",
1184
1216
  "--cd",
1185
1217
  thread.worktreePath,
1186
1218
  "--json",
1187
1219
  "--sandbox",
1188
1220
  mode.codexSandbox,
1189
- "--ask-for-approval",
1190
- "never",
1221
+ // `codex exec` rejects `--ask-for-approval` (global-only on newer CLIs).
1222
+ "-c",
1223
+ 'approval_policy="never"',
1191
1224
  ...model ? ["--model", model] : [],
1192
1225
  ...mcpOverrides
1193
1226
  ];
1227
+ const args = sessionId ? ["exec", ...execOpts, "resume", sessionId, promptArg] : ["exec", ...execOpts, promptArg];
1194
1228
  return {
1195
1229
  file: "codex",
1196
1230
  args,
@@ -1292,7 +1326,7 @@ var codexAdapter = {
1292
1326
  if (sessionId) {
1293
1327
  return {
1294
1328
  file: "codex",
1295
- args: ["exec", "resume", sessionId, "--cd", thread.worktreePath],
1329
+ args: ["exec", "--cd", thread.worktreePath, "resume", sessionId],
1296
1330
  cwd: thread.worktreePath
1297
1331
  };
1298
1332
  }
@@ -1308,12 +1342,12 @@ var codexAdapter = {
1308
1342
  "codex",
1309
1343
  [
1310
1344
  "exec",
1311
- prompt,
1312
1345
  "--json",
1313
1346
  "--sandbox",
1314
1347
  "read-only",
1315
- "--ask-for-approval",
1316
- "never"
1348
+ "-c",
1349
+ 'approval_policy="never"',
1350
+ prompt
1317
1351
  ],
1318
1352
  { reject: false }
1319
1353
  );
@@ -1421,26 +1455,13 @@ var cursorAdapter = {
1421
1455
  reason: "CURSOR_API_KEY not set \u2014 add it in Settings \u2192 Agents \u2192 Cursor, or Settings \u2192 Environment"
1422
1456
  };
1423
1457
  }
1424
- try {
1425
- await Cursor.models.list({ apiKey });
1426
- return {
1427
- agent: "cursor",
1428
- installed: true,
1429
- authenticated: true,
1430
- linearMcp: false,
1431
- warnings: []
1432
- };
1433
- } catch (err) {
1434
- const message = err instanceof Error ? err.message : String(err);
1435
- return {
1436
- agent: "cursor",
1437
- installed: true,
1438
- authenticated: false,
1439
- linearMcp: false,
1440
- warnings: [],
1441
- reason: `Cursor API auth failed: ${message}`
1442
- };
1443
- }
1458
+ return {
1459
+ agent: "cursor",
1460
+ installed: true,
1461
+ authenticated: true,
1462
+ linearMcp: false,
1463
+ warnings: []
1464
+ };
1444
1465
  },
1445
1466
  async buildTurn(thread, input) {
1446
1467
  const prompt = flattenTurnInput(input);
@@ -1448,7 +1469,8 @@ var cursorAdapter = {
1448
1469
  const apiKey = resolveCursorApiKey() || void 0;
1449
1470
  const injected = await buildInjectedMcpServers({
1450
1471
  includeSideboard: true,
1451
- includeBrightsy: isBrightsyConnected()
1472
+ includeBrightsy: isBrightsyConnected(),
1473
+ orchestratorThreadId: thread.sourceType === "orchestration" ? thread.id : null
1452
1474
  });
1453
1475
  const mcpServers = toCursorMcpServers(injected);
1454
1476
  const req = {
@@ -1606,7 +1628,8 @@ var opencodeAdapter = {
1606
1628
  }
1607
1629
  const injected = await buildInjectedMcpServers({
1608
1630
  includeSideboard: true,
1609
- includeBrightsy: isBrightsyConnected()
1631
+ includeBrightsy: isBrightsyConnected(),
1632
+ orchestratorThreadId: thread.sourceType === "orchestration" ? thread.id : null
1610
1633
  });
1611
1634
  const mcpContent = injected.length > 0 ? toOpencodeMcpConfigContent(injected) : null;
1612
1635
  return {
@@ -7,9 +7,9 @@ import {
7
7
  ensureConnectedBrightsyTeamTokens,
8
8
  getConnectedBrightsyTeamsRaw,
9
9
  listConnectedBrightsyTeams
10
- } from "./chunk-BXJ76RHF.js";
10
+ } from "./chunk-MBAL5FE6.js";
11
11
  import "./chunk-M37RITA6.js";
12
- import "./chunk-7LNGIP3X.js";
12
+ import "./chunk-73AT5K4A.js";
13
13
  export {
14
14
  applyConnectedTeamToCli,
15
15
  brightsyMcpServerName,
@@ -9,8 +9,8 @@ import {
9
9
  ensureConnectedBrightsyTeamTokens,
10
10
  getConnectedBrightsyTeamsRaw,
11
11
  listConnectedBrightsyTeams
12
- } from "./chunk-H6GGDLYS.js";
13
- import "./chunk-ZNM4MAN4.js";
12
+ } from "./chunk-JB2H7E7V.js";
13
+ import "./chunk-RIWUU7FO.js";
14
14
  import "./chunk-7MV3RXSC.js";
15
15
  export {
16
16
  applyConnectedTeamToCli,
@@ -8,12 +8,12 @@ import {
8
8
  enrichWorkspacesWithGithub,
9
9
  ensureGlobalCoordinatorCwd,
10
10
  formatWorkspaceInventory
11
- } from "./chunk-DQJ5D42H.js";
12
- import "./chunk-XOU6HNQJ.js";
11
+ } from "./chunk-NTYRBRE7.js";
12
+ import "./chunk-MFGGIRUA.js";
13
13
  import "./chunk-B3SJXYIJ.js";
14
14
  import "./chunk-HLEX5AQ6.js";
15
- import "./chunk-ZNM4MAN4.js";
16
- import "./chunk-C4BCC5X5.js";
15
+ import "./chunk-RIWUU7FO.js";
16
+ import "./chunk-FGNBTFRD.js";
17
17
  import "./chunk-KGZBYWZ3.js";
18
18
  import "./chunk-7MV3RXSC.js";
19
19
  export {
@@ -6,14 +6,14 @@ import {
6
6
  enrichWorkspacesWithGithub,
7
7
  ensureGlobalCoordinatorCwd,
8
8
  formatWorkspaceInventory
9
- } from "./chunk-UA5NDAHL.js";
10
- import "./chunk-DIOF73S2.js";
11
- import "./chunk-DZFH2KLT.js";
9
+ } from "./chunk-XWPKLRB3.js";
10
+ import "./chunk-75QR74KM.js";
11
+ import "./chunk-P7EQUFB6.js";
12
12
  import "./chunk-FKOIHGKV.js";
13
13
  import "./chunk-TSRXOSVD.js";
14
14
  import "./chunk-77WWLBCI.js";
15
15
  import "./chunk-M37RITA6.js";
16
- import "./chunk-7LNGIP3X.js";
16
+ import "./chunk-73AT5K4A.js";
17
17
  export {
18
18
  COORDINATOR_TOOL_PLAYBOOK,
19
19
  coordinatorGreenfieldPlaybook,
@@ -13,14 +13,14 @@ import {
13
13
  orchestrationTitleNeedsSoccerNickname,
14
14
  orchestratorSessionPoisonedByBuiltins,
15
15
  takenTeamSlugsForOrchestration
16
- } from "./chunk-EBWEKG52.js";
16
+ } from "./chunk-CHGOMFTA.js";
17
17
  import "./chunk-S2LL5HA4.js";
18
- import "./chunk-DQJ5D42H.js";
19
- import "./chunk-XOU6HNQJ.js";
18
+ import "./chunk-NTYRBRE7.js";
19
+ import "./chunk-MFGGIRUA.js";
20
20
  import "./chunk-B3SJXYIJ.js";
21
21
  import "./chunk-HLEX5AQ6.js";
22
- import "./chunk-ZNM4MAN4.js";
23
- import "./chunk-C4BCC5X5.js";
22
+ import "./chunk-RIWUU7FO.js";
23
+ import "./chunk-FGNBTFRD.js";
24
24
  import "./chunk-KGZBYWZ3.js";
25
25
  import {
26
26
  globalAgentCwd
@@ -11,18 +11,18 @@ import {
11
11
  orchestrationTitleNeedsSoccerNickname,
12
12
  orchestratorSessionPoisonedByBuiltins,
13
13
  takenTeamSlugsForOrchestration
14
- } from "./chunk-S42XDFKF.js";
14
+ } from "./chunk-MLAST5BB.js";
15
15
  import "./chunk-GI7E5733.js";
16
- import "./chunk-UA5NDAHL.js";
17
- import "./chunk-DIOF73S2.js";
18
- import "./chunk-DZFH2KLT.js";
16
+ import "./chunk-XWPKLRB3.js";
17
+ import "./chunk-75QR74KM.js";
18
+ import "./chunk-P7EQUFB6.js";
19
19
  import "./chunk-FKOIHGKV.js";
20
20
  import "./chunk-TSRXOSVD.js";
21
21
  import "./chunk-77WWLBCI.js";
22
22
  import {
23
23
  globalAgentCwd
24
24
  } from "./chunk-M37RITA6.js";
25
- import "./chunk-7LNGIP3X.js";
25
+ import "./chunk-73AT5K4A.js";
26
26
  export {
27
27
  GLOBAL_WORKSPACE_ID,
28
28
  createGlobalChat,