@sideboard-ai/core 0.1.79 → 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-EWPHOM6Y.js → agents-3YPUZME7.js} +6 -5
  4. package/dist/{agents-GRAPUXWW.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-6T2SKGCS.js → chunk-DJFGX4RT.js} +3 -3
  8. package/dist/{chunk-HCGEFU3J.js → chunk-E2MIA7DO.js} +13 -14
  9. package/dist/{chunk-HSLQXL6M.js → chunk-ERJS3ZDP.js} +13 -14
  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-P33ZQ7ZC.js → chunk-JMRJ4F5B.js} +70 -25
  14. package/dist/{chunk-SHCR6RPU.js → chunk-JW6YFPQE.js} +83 -24
  15. package/dist/{chunk-PW5YHHP3.js → chunk-LVTNWH7B.js} +2 -2
  16. package/dist/{chunk-5LXWTU3J.js → chunk-NXXT5SE3.js} +3 -3
  17. package/dist/{chunk-5VTWBI3I.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-2OVON2LQ.js → coordinator-prompt-46JE4NQR.js} +4 -3
  21. package/dist/{coordinator-prompt-K2R34A5T.js → coordinator-prompt-6ICA54JR.js} +3 -3
  22. package/dist/{global-workspace-VG44RZUH.js → global-workspace-GSLCEB5E.js} +5 -4
  23. package/dist/{global-workspace-RI367AM6.js → global-workspace-OBRWUPZG.js} +4 -4
  24. package/dist/index.cjs +268 -151
  25. package/dist/index.d.cts +52 -11
  26. package/dist/index.d.ts +52 -11
  27. package/dist/index.js +87 -87
  28. package/dist/mcp/run-stdio.cjs +249 -141
  29. package/dist/mcp/run-stdio.js +66 -76
  30. package/dist/{workspaces-TYPJNUSM.js → workspaces-7B3PTEF4.js} +6 -5
  31. package/dist/{workspaces-BQWQEZWE.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
@@ -2,6 +2,7 @@
2
2
 
3
3
  import {
4
4
  PLAN_MODE_INSTRUCTION,
5
+ applyTurnUsage,
5
6
  fallbackTurnFailDetail,
6
7
  formatTurnExitError,
7
8
  getAdapter,
@@ -16,14 +17,14 @@ import {
16
17
  resolveQuotaFallbackAgent,
17
18
  sideboardMcpProfile,
18
19
  summarizeTurnStderr
19
- } from "../chunk-P33ZQ7ZC.js";
20
+ } from "../chunk-JMRJ4F5B.js";
20
21
  import "../chunk-VROPG6QF.js";
21
22
  import {
22
23
  addWorkspace,
23
24
  ensureWorkspace,
24
25
  removeWorkspace,
25
26
  syncWorkspacesFromThreads
26
- } from "../chunk-5VTWBI3I.js";
27
+ } from "../chunk-RS54WYYH.js";
27
28
  import {
28
29
  extractPresentedPlan,
29
30
  readPlanFile,
@@ -41,14 +42,14 @@ import {
41
42
  isGlobalThread,
42
43
  isOrchestratorThread,
43
44
  orchestratorSessionPoisonedByBuiltins
44
- } from "../chunk-6T2SKGCS.js";
45
+ } from "../chunk-DJFGX4RT.js";
45
46
  import {
46
47
  SLACK_REPLY_FORMATTING,
47
48
  coordinatorSystemPrompt,
48
49
  coordinatorTurnReminder,
49
50
  enrichWorkspacesWithGithub,
50
51
  ensureGlobalCoordinatorCwd
51
- } from "../chunk-HSLQXL6M.js";
52
+ } from "../chunk-ERJS3ZDP.js";
52
53
  import {
53
54
  addPrStackLayer,
54
55
  allocateTeamName,
@@ -87,7 +88,7 @@ import {
87
88
  takenSlugsFromThread,
88
89
  threadDisplayLabel,
89
90
  worktreeNameFromPath
90
- } from "../chunk-FUUVPN4A.js";
91
+ } from "../chunk-HBBXS2FR.js";
91
92
  import {
92
93
  ATTACHMENTS_DIR,
93
94
  LEGACY_ATTACHMENTS_DIR,
@@ -115,6 +116,7 @@ import {
115
116
  import {
116
117
  childEnvWithAppSettings,
117
118
  disconnectLinearConnection,
119
+ dropNestedElectronEnvFromProcess,
118
120
  isLinearConnected,
119
121
  isSecureFileEncrypted,
120
122
  loadAppSettings,
@@ -125,9 +127,10 @@ import {
125
127
  resolveNewThreadOptions,
126
128
  resolveVaultKey,
127
129
  saveLinearOAuth,
130
+ stripNestedElectronEnv,
128
131
  updateAdvancedSettings,
129
132
  writeSecureJson
130
- } from "../chunk-XKNBSYA7.js";
133
+ } from "../chunk-UHGN4KCL.js";
131
134
  import {
132
135
  writePrivateFile
133
136
  } from "../chunk-NSTQ6QKD.js";
@@ -882,34 +885,6 @@ function normalizeParseResult(parsed) {
882
885
  return Array.isArray(parsed) ? parsed : [parsed];
883
886
  }
884
887
 
885
- // src/agents/usage.ts
886
- function sumOptional(a, b) {
887
- if (a == null && b == null) return void 0;
888
- return (a ?? 0) + (b ?? 0);
889
- }
890
- function requestOccupancy(u) {
891
- return u.inputTokens + (u.cacheReadTokens ?? 0) + (u.cacheWriteTokens ?? 0);
892
- }
893
- function mergeUsage(a, b) {
894
- return {
895
- inputTokens: (a?.inputTokens ?? 0) + b.inputTokens,
896
- outputTokens: (a?.outputTokens ?? 0) + b.outputTokens,
897
- cacheReadTokens: sumOptional(a?.cacheReadTokens, b.cacheReadTokens),
898
- cacheWriteTokens: sumOptional(a?.cacheWriteTokens, b.cacheWriteTokens),
899
- lastRequestTokens: b.lastRequestTokens ?? a?.lastRequestTokens
900
- };
901
- }
902
- function applyTurnUsage(current, incoming, scope = "request") {
903
- if (scope === "turn") {
904
- return {
905
- ...incoming,
906
- lastRequestTokens: current?.lastRequestTokens ?? requestOccupancy(incoming)
907
- };
908
- }
909
- const merged = mergeUsage(current, incoming);
910
- return { ...merged, lastRequestTokens: requestOccupancy(incoming) };
911
- }
912
-
913
888
  // src/agents/spawn.ts
914
889
  async function spawnAgentTurn(thread, input, onEvent) {
915
890
  ensureAgentPath();
@@ -918,9 +893,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
918
893
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
919
894
  );
920
895
  }
921
- const { isGlobalThread: isGlobalThread2 } = await import("../global-workspace-RI367AM6.js");
896
+ const { isGlobalThread: isGlobalThread2 } = await import("../global-workspace-OBRWUPZG.js");
922
897
  if (isGlobalThread2(thread)) {
923
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("../coordinator-prompt-K2R34A5T.js");
898
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("../coordinator-prompt-6ICA54JR.js");
924
899
  ensureGlobalCoordinatorCwd2(
925
900
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
926
901
  );
@@ -1119,7 +1094,8 @@ function agentGitPrompt(action, opts) {
1119
1094
  return "Commit, push, and open a PR in the browser.";
1120
1095
  case "resolve-conflicts": {
1121
1096
  const base = opts?.prBase?.trim().replace(/^refs\/heads\//, "");
1122
- return base ? `Merge origin/${base} into this branch. Then push.` : "Fix merge conflicts.";
1097
+ const named = base ? ` (${base})` : "";
1098
+ return `Merge the remote branch${named} into your branch and resolve conflicts. Then, commit and push your changes.`;
1123
1099
  }
1124
1100
  case "merge":
1125
1101
  return "Merge PR.";
@@ -1235,16 +1211,6 @@ async function captureLoginEnv() {
1235
1211
  cachedLoginEnv = { ...process.env };
1236
1212
  return { ...cachedLoginEnv };
1237
1213
  }
1238
- var NESTED_ELECTRON_ENV_PREFIXES = ["ELECTRON_", "CHROME_"];
1239
- function stripNestedElectronEnv(env) {
1240
- const out = { ...env };
1241
- for (const key of Object.keys(out)) {
1242
- if (NESTED_ELECTRON_ENV_PREFIXES.some((prefix) => key.startsWith(prefix))) {
1243
- delete out[key];
1244
- }
1245
- }
1246
- return out;
1247
- }
1248
1214
  function buildWorkspaceScriptEnv(opts, baseEnv) {
1249
1215
  const env = stripNestedElectronEnv({
1250
1216
  ...baseEnv ?? process.env
@@ -1852,7 +1818,7 @@ async function createThread(input, _onSetupLine) {
1852
1818
  return readThread(thread.id) ?? thread;
1853
1819
  }
1854
1820
  async function listLinearIssues(agent, repoPath) {
1855
- const { getAdapter: getAdapter2 } = await import("../agents-GRAPUXWW.js");
1821
+ const { getAdapter: getAdapter2 } = await import("../agents-4KRD46KG.js");
1856
1822
  await requireAgent(agent, { requireLinear: true });
1857
1823
  const adapter = getAdapter2(agent);
1858
1824
  if (!adapter.listLinearIssues) {
@@ -2366,6 +2332,10 @@ File: src/client/frontends/desktop/core/UserData.ts
2366
2332
 
2367
2333
  **Approve** \u2014 Diff is scoped, behavior looks correct, and there are no blocking issues. Safe to merge.
2368
2334
  </example>
2335
+
2336
+ ## Growing the rules
2337
+
2338
+ If a blocking issue is a missing or ambiguous repo rule that will recur, say so and propose one sentence for \`.sideboard/review.md\` or a \`.claude/skills/<name>/SKILL.md\`. Do not only patch this diff when the same miss will happen again. New skills go under \`.claude/skills\` (Claude Code / attach) \u2014 not \`.sideboard/skills\`.
2369
2339
  `;
2370
2340
 
2371
2341
  // src/review/request-review.ts
@@ -2716,7 +2686,7 @@ async function adoptThread(input) {
2716
2686
  messages: input.messages ?? []
2717
2687
  });
2718
2688
  writeThread(thread);
2719
- const { ensureWorkspace: ensureWorkspace2 } = await import("../workspaces-BQWQEZWE.js");
2689
+ const { ensureWorkspace: ensureWorkspace2 } = await import("../workspaces-RJIWQB6J.js");
2720
2690
  await ensureWorkspace2(repoPath);
2721
2691
  return thread;
2722
2692
  }
@@ -4487,7 +4457,7 @@ function formatWorktreeDirective(thread, opts) {
4487
4457
  "- Prefer a concise imperative title (Conventional Commits style when it fits: feat:/fix:/chore:/docs:). Body should summarize intent, key changes, and test notes."
4488
4458
  );
4489
4459
  lines.push(
4490
- "- Commit with messages that state the purpose of the change (same standard as the PR). Stay on this thread branch. Never push directly to main/master or merge locally into the main checkout. When asked to merge the PR, use GitHub from this worktree (`gh pr merge` / `gh stack merge`)."
4460
+ "- Commit with messages that state the purpose of the change (same standard as the PR). Stay on this thread branch. Never push directly to main/master or merge locally into the main checkout. Do not merge the PR unless this turn is a Merge PR request or the user explicitly asked. When merging, use GitHub from this worktree (`gh pr merge` / `gh stack merge`)."
4491
4461
  );
4492
4462
  if (thread.prUrl) {
4493
4463
  lines.push(
@@ -4519,19 +4489,30 @@ function formatWorktreeDirective(thread, opts) {
4519
4489
  '- "Fix CI: <name>." \u2192 investigate that failing check, fix it, commit, and push.'
4520
4490
  );
4521
4491
  lines.push(
4522
- '- "Update the branch." / "Fix merge conflicts." / "Merge origin/<base> into this branch. Then push." \u2192 sync with the PR base (merge or rebase), resolve conflicts carefully, commit, and push until the PR is mergeable.'
4492
+ '- "Merge the remote branch (<base>) into your branch and resolve conflicts. Then, commit and push your changes." \u2192 fetch the PR base, merge it into this branch, resolve conflicts carefully, commit, and push until the PR is mergeable.'
4523
4493
  );
4524
4494
  lines.push(
4525
4495
  '- "Address review comments." \u2192 read PR review feedback, make the requested changes, commit, and push.'
4526
4496
  );
4527
4497
  lines.push(
4528
- '- "Merge PR." \u2192 merge this thread\'s open pull request on GitHub. If `gh stack view` shows a stack, use `gh stack merge`; otherwise `gh pr merge` (respect repo defaults / squash vs merge). Do not force-push main/master or merge locally into the main checkout.'
4498
+ '- "Merge PR." \u2192 merge this thread\'s open pull request on GitHub (this phrase is the explicit ask). If `gh stack view` shows a stack, use `gh stack merge`; otherwise `gh pr merge` (respect repo defaults / squash vs merge). Do not force-push main/master or merge locally into the main checkout.'
4529
4499
  );
4500
+ lines.push("");
4501
+ lines.push(formatProcessGuideDirective());
4530
4502
  return lines.join("\n");
4531
4503
  }
4532
4504
  function formatWorktreeReminder() {
4533
4505
  return "Sideboard worktree: stay in this cwd for all file and git work. Push and open PRs against origin, never upstream. Do not edit the main repo checkout.";
4534
4506
  }
4507
+ function formatProcessGuideDirective() {
4508
+ return [
4509
+ "Process guides (recurring work only):",
4510
+ "- If `.claude/skills/graph-engineering/SKILL.md` exists, follow it (`/graph-engineering`) for migrations, ports, batch fixes, and other fan-out. Judge first; state on disk; grow the rulebook; do not patch around it.",
4511
+ "- If this same shape of work will happen again, write `.claude/skills/<kebab-name>/SKILL.md` in this worktree (Claude Code project skill). Sideboard `/name`, Claude Code, and `attach` all load that path. Do not leave the method only in chat.",
4512
+ "- Do not write new skills under `.sideboard/skills` \u2014 native agents do not scan it. Point Codex/OpenCode at the file from `AGENTS.md`. Optional: symlink `.cursor/skills/<name>` to the Claude skill.",
4513
+ "- Skip a guide for a one-off. If a matching skill exists, follow it. Same miss twice \u2192 edit the skill (or `.sideboard/review.md`), do not patch around it."
4514
+ ].join("\n");
4515
+ }
4535
4516
  function formatArtifactDirective() {
4536
4517
  return [
4537
4518
  "Sideboard side column (desktop UI):",
@@ -4549,9 +4530,22 @@ function formatArtifactDirective() {
4549
4530
  "Files / media browser (CMS file manager column):",
4550
4531
  "4) Call Sideboard MCP `present_files` with optional title, path, and datasource (brightsy|memory).",
4551
4532
  " Opens the Files column for browse/upload/pick. Do NOT say a file manager UI is missing.",
4552
- "Never say artifacts, CMS UI, or the Files column are unavailable. Prefer present_schema for list/edit/publish; present_files for storage UI; html fences for standalone pages."
4533
+ "Multiple-choice questions (any mode \u2014 not only Plan):",
4534
+ "5) Call Sideboard MCP `ask_user` when the user should pick from predefined options (approach forks, requirements, which API). First write a short chat message that explains the decision and what each option means (tradeoffs, when to pick it). Include a description on every option. After calling, stop and wait for their next message with answers. Do not ask multiple-choice questions as plain chat bullets \u2014 use ask_user so Sideboard shows the composer picker.",
4535
+ "Never say artifacts, CMS UI, or the Files column are unavailable. Prefer present_schema for list/edit/publish; present_files for storage UI; html fences for standalone pages; ask_user for predefined-option questions."
4553
4536
  ].join("\n");
4554
4537
  }
4538
+ function formatUiReminder() {
4539
+ return [
4540
+ "Sideboard side column (important):",
4541
+ "There is no claude.ai Artifact tool here \u2014 that is normal.",
4542
+ "HTML/SVG/markdown: ```html fence or MCP present_artifact.",
4543
+ "CMS forms/tables: MCP present_schema (Brightsy resource_id or inline schema+schemaUi).",
4544
+ "Files column: MCP present_files (brightsy account storage or memory).",
4545
+ "Do not say artifacts/CMS UI are unavailable.",
4546
+ "Multiple-choice questions: MCP ask_user (composer picker, any mode). Explain options in chat first, then wait for answers."
4547
+ ].join(" ");
4548
+ }
4555
4549
 
4556
4550
  // src/threads/sync-branch.ts
4557
4551
  async function syncThreadBranchFromGit(threadId) {
@@ -4684,7 +4678,7 @@ var Orchestrator = class {
4684
4678
  orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
4685
4679
  });
4686
4680
  }
4687
- const { autoCleanupOrphansEnabled } = await import("../app-settings-NILNWNNQ.js");
4681
+ const { autoCleanupOrphansEnabled } = await import("../app-settings-GVSOIJLZ.js");
4688
4682
  if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
4689
4683
  await cleanupOrphanWorktrees({ repoPaths });
4690
4684
  }
@@ -4841,7 +4835,7 @@ var Orchestrator = class {
4841
4835
  }
4842
4836
  async finishCreateThread(threadId, prompt) {
4843
4837
  await this.runSetupAfterCreate(threadId);
4844
- const { autoRunAfterSetupEnabled } = await import("../app-settings-NILNWNNQ.js");
4838
+ const { autoRunAfterSetupEnabled } = await import("../app-settings-GVSOIJLZ.js");
4845
4839
  if (autoRunAfterSetupEnabled()) {
4846
4840
  try {
4847
4841
  await this.startDev(threadId);
@@ -5083,14 +5077,7 @@ var Orchestrator = class {
5083
5077
  SLACK_REPLY_FORMATTING
5084
5078
  ].join("\n") : null
5085
5079
  ].filter(Boolean).join("\n") : null;
5086
- const artifactReminder = thread.agent !== "brightsy" ? [
5087
- "Sideboard side column (important):",
5088
- "There is no claude.ai Artifact tool here \u2014 that is normal.",
5089
- "HTML/SVG/markdown: ```html fence or MCP present_artifact.",
5090
- "CMS forms/tables: MCP present_schema (Brightsy resource_id or inline schema+schemaUi).",
5091
- "Files column: MCP present_files (brightsy account storage or memory).",
5092
- "Do not say artifacts/CMS UI are unavailable."
5093
- ].join(" ") : null;
5080
+ const artifactReminder = thread.agent !== "brightsy" ? formatUiReminder() : null;
5094
5081
  const worktreeReminder = thread.agent !== "brightsy" && !isOrchestratorThread(thread) ? formatWorktreeReminder() : null;
5095
5082
  const slackReplyContext = formatSlackRepliesForTurn(
5096
5083
  pendingSlackExternalReplies(thread.messages)
@@ -5119,7 +5106,7 @@ var Orchestrator = class {
5119
5106
  }
5120
5107
  const isBrightsy = fresh.agent === "brightsy";
5121
5108
  const isOrchestration = isOrchestratorThread(fresh);
5122
- const { autoRenameBranchEnabled, getGithubGitAuthMode } = await import("../app-settings-NILNWNNQ.js");
5109
+ const { autoRenameBranchEnabled, getGithubGitAuthMode } = await import("../app-settings-GVSOIJLZ.js");
5123
5110
  const gitAuthMode = getGithubGitAuthMode();
5124
5111
  const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
5125
5112
  githubSlug: await resolveGithubRepoSlug(fresh.worktreePath).catch(
@@ -5784,7 +5771,9 @@ var Orchestrator = class {
5784
5771
  reviewDecision: null,
5785
5772
  baseRefName: "",
5786
5773
  headRefName: "",
5787
- isInMergeQueue: false
5774
+ isInMergeQueue: false,
5775
+ mergeable: null,
5776
+ mergeStateStatus: null
5788
5777
  };
5789
5778
  await this.persistPrMetaAndMaybeArchive(thread, metaLike);
5790
5779
  return { url: metaLike.url, state };
@@ -5834,7 +5823,7 @@ var Orchestrator = class {
5834
5823
  updateThread(thread.id, { title: meta.title });
5835
5824
  }
5836
5825
  }
5837
- const { autoArchiveOnMergeEnabled } = await import("../app-settings-NILNWNNQ.js");
5826
+ const { autoArchiveOnMergeEnabled } = await import("../app-settings-GVSOIJLZ.js");
5838
5827
  const latest = this.requireThread(thread.id);
5839
5828
  if (!shouldAutoArchiveOnPrMerge({
5840
5829
  previousPrState: prevState || null,
@@ -6122,7 +6111,7 @@ var Orchestrator = class {
6122
6111
  this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
6123
6112
  if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
6124
6113
  try {
6125
- const { ensureWorkspace: ensureWorkspace2 } = await import("../workspaces-BQWQEZWE.js");
6114
+ const { ensureWorkspace: ensureWorkspace2 } = await import("../workspaces-RJIWQB6J.js");
6126
6115
  await ensureWorkspace2(thread.repoPath);
6127
6116
  } catch {
6128
6117
  }
@@ -6144,7 +6133,7 @@ var Orchestrator = class {
6144
6133
  await runArchiveScript(thread.repoPath, thread.worktreePath);
6145
6134
  } catch {
6146
6135
  }
6147
- const { deleteBranchOnPurgeEnabled } = await import("../app-settings-NILNWNNQ.js");
6136
+ const { deleteBranchOnPurgeEnabled } = await import("../app-settings-GVSOIJLZ.js");
6148
6137
  const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
6149
6138
  await removeWorktree(thread.repoPath, thread.worktreePath, {
6150
6139
  deleteBranch: deleteBranch ? thread.branchName : void 0
@@ -6165,7 +6154,7 @@ var Orchestrator = class {
6165
6154
  return restored2;
6166
6155
  }
6167
6156
  if (!existsSync15(thread.worktreePath)) {
6168
- const { createThreadWorktree: createThreadWorktree2 } = await import("../worktree-UNSOCYZU.js");
6157
+ const { createThreadWorktree: createThreadWorktree2 } = await import("../worktree-U3UIID2K.js");
6169
6158
  const { execa: execa6 } = await import("execa");
6170
6159
  const slug = thread.worktreePath.split("/").pop();
6171
6160
  const dest = thread.worktreePath;
@@ -7336,7 +7325,7 @@ function withTimeout(promise, ms, label) {
7336
7325
  async function startMcpServer() {
7337
7326
  const orch = getOrchestrator();
7338
7327
  try {
7339
- const { maxConcurrentAgents } = await import("../app-settings-NILNWNNQ.js");
7328
+ const { maxConcurrentAgents } = await import("../app-settings-GVSOIJLZ.js");
7340
7329
  orch.setMaxConcurrent(maxConcurrentAgents());
7341
7330
  } catch {
7342
7331
  }
@@ -7441,7 +7430,7 @@ async function startMcpServer() {
7441
7430
  );
7442
7431
  server.tool(
7443
7432
  "ask_user",
7444
- "Ask the user clarifying multiple-choice questions in Sideboard\u2019s composer (plan mode). Before calling, write a short chat message explaining the decision and what each option means. Include a description on every option. Use for approach forks and requirements \u2014 not for \u201Cis the plan ready?\u201D. After calling, stop and wait for their next message with answers.",
7433
+ "Ask the user clarifying multiple-choice questions in Sideboard\u2019s composer (any mode \u2014 not only Plan). Before calling, write a short chat message explaining the decision and what each option means. Include a description on every option. Use when the user should pick from predefined options (approach forks, requirements, which API) \u2014 not for \u201Cis the plan ready?\u201D. After calling, stop and wait for their next message with answers.",
7445
7434
  {
7446
7435
  questions: z3.array(
7447
7436
  z3.object({
@@ -7546,7 +7535,7 @@ async function startMcpServer() {
7546
7535
  registerLinearTools(server);
7547
7536
  if (sideboardMcpProfile() !== "worktree") {
7548
7537
  const { getCaffeinateHold, setCaffeinateHold } = await import("../caffeinate-hold-OHAUWOA6.js");
7549
- const { resolveNewThreadOptions: resolveNewThreadOptions2, resolveThreadDefaults } = await import("../app-settings-NILNWNNQ.js");
7538
+ const { resolveNewThreadOptions: resolveNewThreadOptions2, resolveThreadDefaults } = await import("../app-settings-GVSOIJLZ.js");
7550
7539
  const accountDefaults = resolveThreadDefaults();
7551
7540
  const accountDefaultsHint = `Account defaults: agent=${accountDefaults.agent}, model=${accountDefaults.model?.trim() || "Auto"}, effort=${accountDefaults.effort}`;
7552
7541
  server.tool(
@@ -7704,7 +7693,7 @@ async function startMcpServer() {
7704
7693
  );
7705
7694
  server.tool(
7706
7695
  "send_to_thread",
7707
- "Queue a prompt on a worktree thread chat (runs under concurrency cap). Use after create_thread to start or continue a conversation. For commit/push/PR/merge, prefer ask_git (canonical desktop-button phrases). Set force_stop=true to interrupt an in-flight/queued turn (kill + clear queue) before queueing this prompt \u2014 use when the thread is mid-turn or has stale queued prompts you need to replace.",
7696
+ 'Queue a prompt on a worktree thread chat (runs under concurrency cap). Use after create_thread to start or continue a conversation. For commit/push/PR, prefer ask_git (canonical desktop-button phrases). Send "Merge PR." / ask_git merge only when the user explicitly asked to merge. Set force_stop=true to interrupt an in-flight/queued turn (kill + clear queue) before queueing this prompt \u2014 use when the thread is mid-turn or has stale queued prompts you need to replace.',
7708
7697
  {
7709
7698
  ref: z3.string(),
7710
7699
  prompt: z3.string(),
@@ -7800,7 +7789,7 @@ async function startMcpServer() {
7800
7789
  );
7801
7790
  server.tool(
7802
7791
  "archive_thread",
7803
- "Archive a thread (stops agent/dev, runs archive script, removes worktree when last chat tab). Coordinators commit, push, open PRs, and merge only by asking the worktree agent (ask_git).",
7792
+ "Archive a thread (stops agent/dev, runs archive script, removes worktree when last chat tab). Coordinators commit, push, and open PRs by asking the worktree agent (ask_git). Merge only when the user explicitly asked.",
7804
7793
  { ref: z3.string() },
7805
7794
  async ({ ref }) => {
7806
7795
  const t = orch.getThread(ref);
@@ -7908,7 +7897,7 @@ async function startMcpServer() {
7908
7897
  );
7909
7898
  server.tool(
7910
7899
  "ask_git",
7911
- "Commit & push, open a draft PR, resolve conflicts, or merge \u2014 same actions as the desktop git buttons. When the worktree is clean, Sideboard pushes / opens the PR itself (HTTPS via `gh` if SSH is missing). When dirty, queues the worktree agent to commit; then wait_for_turn. Pass a worktree thread ref (not the orchestrator). Do not run git or gh from the orchestration cwd.",
7900
+ "Commit & push, open a draft PR, resolve conflicts, or merge \u2014 same actions as the desktop git buttons. When the worktree is clean, Sideboard pushes / opens the PR itself (HTTPS via `gh` if SSH is missing). When dirty, queues the worktree agent to commit; then wait_for_turn. Pass a worktree thread ref (not the orchestrator). action=merge only when the user explicitly asked to merge that PR. Do not run git or gh from the orchestration cwd.",
7912
7901
  {
7913
7902
  ref: z3.string().describe("Worktree thread id/ref"),
7914
7903
  action: z3.enum(AGENT_GIT_ACTIONS).describe(
@@ -8209,7 +8198,7 @@ async function startMcpServer() {
8209
8198
  );
8210
8199
  server.tool(
8211
8200
  "get_pr_stack",
8212
- "Load the GitHub PR stack for a thread worktree (`gh stack view --json`). Returns null JSON when the branch is not stacked. Prefer this before ask_git merge on stacked PRs.",
8201
+ "Load the GitHub PR stack for a thread worktree (`gh stack view --json`). Returns null JSON when the branch is not stacked. Prefer this before ask_git merge on stacked PRs (and only merge when the user explicitly asked).",
8213
8202
  { ref: z3.string() },
8214
8203
  async ({ ref }) => {
8215
8204
  const stack = await orch.getPrStack(ref);
@@ -8355,6 +8344,7 @@ async function startMcpServer() {
8355
8344
  }
8356
8345
 
8357
8346
  // src/mcp/run-stdio.ts
8347
+ dropNestedElectronEnvFromProcess();
8358
8348
  startMcpServer().catch((err) => {
8359
8349
  console.error(err);
8360
8350
  process.exitCode = 1;
@@ -4,12 +4,13 @@ import {
4
4
  listWorkspaces,
5
5
  removeWorkspace,
6
6
  syncWorkspacesFromThreads
7
- } from "./chunk-PW5YHHP3.js";
8
- import "./chunk-5LXWTU3J.js";
9
- import "./chunk-HCGEFU3J.js";
10
- import "./chunk-YVVXWWCC.js";
7
+ } from "./chunk-LVTNWH7B.js";
8
+ import "./chunk-NXXT5SE3.js";
9
+ import "./chunk-E2MIA7DO.js";
10
+ import "./chunk-GD2FM6FN.js";
11
11
  import "./chunk-FKOIHGKV.js";
12
- import "./chunk-IFPN6TER.js";
12
+ import "./chunk-YO3CYL6B.js";
13
+ import "./chunk-IZ7RPF54.js";
13
14
  import "./chunk-JT7R45JB.js";
14
15
  import "./chunk-FWJYLBO6.js";
15
16
  import "./chunk-77WWLBCI.js";
@@ -6,14 +6,14 @@ import {
6
6
  listWorkspaces,
7
7
  removeWorkspace,
8
8
  syncWorkspacesFromThreads
9
- } from "./chunk-5VTWBI3I.js";
10
- import "./chunk-6T2SKGCS.js";
11
- import "./chunk-HSLQXL6M.js";
12
- import "./chunk-FUUVPN4A.js";
9
+ } from "./chunk-RS54WYYH.js";
10
+ import "./chunk-DJFGX4RT.js";
11
+ import "./chunk-ERJS3ZDP.js";
12
+ import "./chunk-HBBXS2FR.js";
13
13
  import "./chunk-B3SJXYIJ.js";
14
14
  import "./chunk-7FD7COKE.js";
15
15
  import "./chunk-AE5VBOFE.js";
16
- import "./chunk-XKNBSYA7.js";
16
+ import "./chunk-UHGN4KCL.js";
17
17
  import "./chunk-NSTQ6QKD.js";
18
18
  import "./chunk-KGZBYWZ3.js";
19
19
  import "./chunk-7MV3RXSC.js";
@@ -44,9 +44,10 @@ import {
44
44
  worktreeDisplayLabel,
45
45
  worktreeDisplayLabelForGroup,
46
46
  worktreeNameFromPath
47
- } from "./chunk-YVVXWWCC.js";
47
+ } from "./chunk-GD2FM6FN.js";
48
48
  import "./chunk-FKOIHGKV.js";
49
- import "./chunk-IFPN6TER.js";
49
+ import "./chunk-YO3CYL6B.js";
50
+ import "./chunk-IZ7RPF54.js";
50
51
  import "./chunk-JT7R45JB.js";
51
52
  import "./chunk-FWJYLBO6.js";
52
53
  import "./chunk-77WWLBCI.js";
@@ -46,11 +46,11 @@ import {
46
46
  worktreeDisplayLabel,
47
47
  worktreeDisplayLabelForGroup,
48
48
  worktreeNameFromPath
49
- } from "./chunk-FUUVPN4A.js";
49
+ } from "./chunk-HBBXS2FR.js";
50
50
  import "./chunk-B3SJXYIJ.js";
51
51
  import "./chunk-7FD7COKE.js";
52
52
  import "./chunk-AE5VBOFE.js";
53
- import "./chunk-XKNBSYA7.js";
53
+ import "./chunk-UHGN4KCL.js";
54
54
  import "./chunk-NSTQ6QKD.js";
55
55
  import "./chunk-KGZBYWZ3.js";
56
56
  import "./chunk-7MV3RXSC.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sideboard-ai/core",
3
- "version": "0.1.79",
3
+ "version": "0.1.83",
4
4
  "description": "Sideboard core — orchestration, agents, git worktrees, MCP server",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",