@sideboard-ai/core 0.1.175 → 0.1.177

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.
@@ -12,6 +12,7 @@ import {
12
12
  getAgentSetupInfo,
13
13
  installAgent,
14
14
  installNpmGlobalPackage,
15
+ isCursorApiKeyConfigured,
15
16
  isCursorAutoModel,
16
17
  isSessionQuotaLimit,
17
18
  listAgentSetupInfo,
@@ -31,8 +32,8 @@ import {
31
32
  resolveLoginCommand,
32
33
  resolveQuotaFallbackAgent,
33
34
  whichOnPath
34
- } from "./chunk-QTJ2ERA6.js";
35
- import "./chunk-NA7P3SZL.js";
35
+ } from "./chunk-NIB6BTC6.js";
36
+ import "./chunk-3ZFGZ7RT.js";
36
37
  import "./chunk-7JIYKYLL.js";
37
38
  import "./chunk-6K64FJDD.js";
38
39
  import "./chunk-IEEAVWAP.js";
@@ -87,6 +88,7 @@ export {
87
88
  installAgent,
88
89
  installNpmGlobalPackage,
89
90
  isConductorBundledCli,
91
+ isCursorApiKeyConfigured,
90
92
  isCursorAutoModel,
91
93
  isOrchestratorCapableAgent,
92
94
  isSessionQuotaLimit,
@@ -15,6 +15,7 @@ import {
15
15
  getAgentSetupInfo,
16
16
  installAgent,
17
17
  installNpmGlobalPackage,
18
+ isCursorApiKeyConfigured,
18
19
  isCursorAutoModel,
19
20
  isSessionQuotaLimit,
20
21
  listAgentSetupInfo,
@@ -37,11 +38,11 @@ import {
37
38
  resolveQuotaFallbackAgent,
38
39
  turnCostUsdFromCursorUsage,
39
40
  whichOnPath
40
- } from "./chunk-ZXHV3NHY.js";
41
+ } from "./chunk-W44EKPIR.js";
41
42
  import "./chunk-HVIEYTUK.js";
42
43
  import "./chunk-Y4MIXGPA.js";
43
44
  import "./chunk-VKQGAWHY.js";
44
- import "./chunk-TNOLCU5B.js";
45
+ import "./chunk-FJWQCZ74.js";
45
46
  import "./chunk-7O53GXTA.js";
46
47
  import "./chunk-D6JWYJ4P.js";
47
48
  import "./chunk-LZQULFIT.js";
@@ -86,6 +87,7 @@ export {
86
87
  installAgent,
87
88
  installNpmGlobalPackage,
88
89
  isConductorBundledCli,
90
+ isCursorApiKeyConfigured,
89
91
  isCursorAutoModel,
90
92
  isOrchestratorCapableAgent,
91
93
  isSessionQuotaLimit,
@@ -390,7 +390,7 @@ var COORDINATOR_TOOL_PLAYBOOK = [
390
390
  "Workspaces:",
391
391
  "- add_workspace / remove_workspace \u2014 register or unregister a git repo",
392
392
  "Worktree threads (chats):",
393
- "- create_thread \u2014 create a worktree + chat from branch | pr | ticket (appears on Home). Do not create a second worktree for a ticket, PR, or named branch that already has one \u2014 that call returns the live thread (alreadyStarted=true). Creating from the default branch still opens a new isolated worktree. Pass repoPath + parentThreadId; omit agent and model so Sideboard applies Settings \u2192 Default agent, model & effort (never pass your own agent or agent=cursor). If the repo has a setup script, Sideboard runs it in the background (does not block send_to_thread). Nested Codex (you are Codex and the child is Codex) deadlocks \u2014 omit agent; Sideboard coerces that case",
393
+ "- create_thread \u2014 create a worktree + chat from branch | pr | ticket (appears on Home). Do not create a second worktree for a ticket, PR, or named branch that already has one \u2014 that call returns the live thread (alreadyStarted=true). Creating from the default branch still opens a new isolated worktree. Pass repoPath + parentThreadId; omit agent and model so Sideboard applies Settings \u2192 Default agent, model & effort (never pass your own agent or agent=cursor). If the repo has a setup script, Sideboard runs it in the background (does not block send_to_thread). Nested Codex (you are Codex and the child would be Codex) can deadlock on ~/.codex locks \u2014 omit agent; Sideboard switches the child to Cursor when a CURSOR_API_KEY is set, otherwise keeps the Account default",
394
394
  "- start_board_card \u2014 same as create_thread for a ticket/PR/named branch (attaches issue text when resolvable). Then send_to_thread.",
395
395
  "- fork_worktree \u2014 fork a worktree chat into a NEW git worktree + chat (transcript attached); optional agent; leave model unset (Auto) unless you have a reason. Not for orchestration chats.",
396
396
  "- fork_chat \u2014 fork a worktree chat (same worktree tab) OR a Global orchestration chat (new orchestration tab); optional agent; leave model unset (Auto) unless you have a reason. Remote coordinators: use this to continue another orchestration chat on a different agent after session limits.",
@@ -405,9 +405,9 @@ var COORDINATOR_TOOL_PLAYBOOK = [
405
405
  "- get_diff \u2014 compact diff summary",
406
406
  "- get_pr_checks \u2014 snapshot of a worktree thread's PR checks (null = no PR). Use this to inspect status. If the user gave a goal, the worktree agent watches with `gh pr checks --watch` \u2014 do not poll for the human.",
407
407
  '- request_review \u2014 open a Review chat tab on a worktree thread (attaches .claude/skills/review/SKILL.md when present, else .context/review.md copied from .sideboard/review.md / stock; sends "Review changes in this workspace."); then wait_for_turn (loop while stillRunning) / get_turn_result on the returned id',
408
- "- ask_git \u2014 commit & push, open a draft PR, resolve conflicts, or merge. When the worktree is clean, Sideboard pushes / opens the PR itself. When dirty, it queues the worktree agent \u2014 then wait_for_turn (loop while stillRunning). Prefer this over paraphrasing. If ask_git / get_thread lastError says the GraphQL/PR body is too long, the branch is already pushed \u2014 send_to_thread so the worktree agent runs `gh pr create --body-file` with a short description. Do not invent SSH or auth failures from that error. If the user gave a goal (Greptile 5/5, CI green), send_to_thread that goal so the worktree agent enters the watch-fix-push loop \u2014 do not tell the human to poll.",
408
+ "- ask_git \u2014 commit & push, open a draft PR, mark ready for review, resolve conflicts, or merge. When the worktree is clean, Sideboard pushes / opens the PR itself. When dirty, it queues the worktree agent \u2014 then wait_for_turn (loop while stillRunning). Prefer this over paraphrasing. If ask_git / get_thread lastError says the GraphQL/PR body is too long, the branch is already pushed \u2014 send_to_thread so the worktree agent runs `gh pr create --body-file` with a short description. Do not invent SSH or auth failures from that error. If the user gave a goal (Greptile 5/5, CI green), send_to_thread that goal so the worktree agent enters the watch-fix-push loop \u2014 do not tell the human to poll.",
409
409
  '- Merge (`ask_git` action=merge / send_to_thread "Merge PR.") only when the user explicitly asked to merge that PR. Do not merge because the work looks done, CI is green, or a typical flow includes it.',
410
- '- Or send_to_thread with those exact phrases: "Commit and push.", "Commit, push, and open a draft PR.", "Merge the remote branch (main) into your branch and resolve conflicts. Then, commit and push your changes.", "Merge PR." (draft PRs: `gh pr create --draft -R <origin-owner/name>` using the workspace `github:` slug \u2014 never upstream). Never run git/gh from this orchestration cwd, and never merge the PR yourself.',
410
+ '- Or send_to_thread with those exact phrases: "Commit and push.", "Commit, push, and open a draft PR.", "Ready for review.", "Merge the remote branch (main) into your branch and resolve conflicts. Then, commit and push your changes.", "Merge PR." (draft PRs: `gh pr create --draft -R <origin-owner/name>` using the workspace `github:` slug \u2014 never upstream). Never run git/gh from this orchestration cwd, and never merge the PR yourself.',
411
411
  "Process guides:",
412
412
  "- Long child jobs (pack, test, deploy, anything that may run more than ~30s): workers always have `/long-running` (Sideboard product skill). Tell them to detach and wait; they may `stop_job` if it hangs or is doing the wrong thing; do not ask the human to poll.",
413
413
  "- Recurring multi-item / fan-out: if the child worktree has `.claude/skills/graph-engineering/SKILL.md`, tell the worker to follow it (`/graph-engineering`). Judge first; state on disk; grow the rulebook; do not patch three threads.",
@@ -532,7 +532,7 @@ function ensureGlobalCoordinatorCwd(opts) {
532
532
  "When creating threads, pass `repoPath` from `list_workspaces` (or the path you just registered).",
533
533
  orchId ? `Pass parentThreadId="${orchId}" (or omit it). Never invent another parentThreadId.` : "Pass `parentThreadId` for children (this chat's id from the turn reminder).",
534
534
  "Omit `agent` / `model` on `create_thread`. Sideboard applies Settings \u2192 Default agent, model & effort. Do not pass your own agent or `agent=cursor` \u2014 those are ignored.",
535
- "Never pass `agent=codex` when you yourself are Codex \u2014 nested Codex deadlocks on shared ~/.codex locks. Omit agent; Sideboard applies Account defaults (and coerces only that nested-Codex case).",
535
+ "Never pass `agent=codex` when you yourself are Codex \u2014 nested Codex can deadlock on shared ~/.codex locks. Omit agent; Sideboard applies Account defaults, and switches that nested-Codex case to Cursor only when a CURSOR_API_KEY is configured.",
536
536
  "Typical flow (Home board): list_board \u2192 create_thread (sourceType=ticket|pr|branch) \u2192 send_to_thread \u2192 wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft \u2192 wait_for_turn. Merge only if the user explicitly asked (`ask_git` merge).",
537
537
  "Typical flow (branch / explicit source): list_workspaces \u2192 list_branches|list_prs|list_issues \u2192 create_thread \u2192 send_to_thread \u2192 wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft.",
538
538
  "Typical flow (find work): list_workspaces \u2192 pick repo(s) matching account / project context \u2192 Sideboard list_issues / linear_* (tickets) or list_prs(queue=review) (reviews) \u2192 show the options. Never wait on Claude Linear MCP. Only create_thread + send_to_thread when they asked to start (e.g. \u201Cfind me work and start it\u201D) \u2014 then wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft.",
@@ -33,7 +33,7 @@ import {
33
33
  summarizeTurnStderr,
34
34
  toolDescription,
35
35
  turnFailChatText
36
- } from "./chunk-ZXHV3NHY.js";
36
+ } from "./chunk-W44EKPIR.js";
37
37
  import {
38
38
  extractPresentedPlan,
39
39
  readPlanFile,
@@ -64,7 +64,7 @@ import {
64
64
  stageAbsolutePathsAsAttachments,
65
65
  stageBuffersAsAttachments,
66
66
  syncWorkspacesFromThreads
67
- } from "./chunk-TNOLCU5B.js";
67
+ } from "./chunk-FJWQCZ74.js";
68
68
  import {
69
69
  addPrStackLayer,
70
70
  allocateTeamName,
@@ -148,6 +148,7 @@ import {
148
148
  assertOrchestratorCapableAgent,
149
149
  childEnvWithAppSettings,
150
150
  coerceOrchestratorAgent,
151
+ followUpBehavior,
151
152
  formatViewerContextDirective,
152
153
  formatViewerContextReminder,
153
154
  getIssueSource,
@@ -401,7 +402,7 @@ async function continueSourceThread(threadId, prompt) {
401
402
  await continueOnReply(threadId, prompt);
402
403
  return;
403
404
  }
404
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-QSNGJ2ER.js");
405
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-XAJ3LREM.js");
405
406
  await getOrchestrator2().send(threadId, prompt);
406
407
  } catch {
407
408
  }
@@ -794,9 +795,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
794
795
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
795
796
  );
796
797
  }
797
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-WSQNEALF.js");
798
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-J737XNUX.js");
798
799
  if (isGlobalThread2(thread)) {
799
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-XCQCGUED.js");
800
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-BE2FERYE.js");
800
801
  ensureGlobalCoordinatorCwd2(
801
802
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
802
803
  );
@@ -991,6 +992,7 @@ var AGENT_GIT_ACTIONS = [
991
992
  "create-draft",
992
993
  "create-web",
993
994
  "resolve-conflicts",
995
+ "ready-for-review",
994
996
  "merge"
995
997
  ];
996
998
  function agentGitPrompt(action, opts) {
@@ -1006,6 +1008,8 @@ function agentGitPrompt(action, opts) {
1006
1008
  const named = base ? ` (${base})` : "";
1007
1009
  return `Merge the remote branch${named} into your branch and resolve conflicts. Then, commit and push your changes.`;
1008
1010
  }
1011
+ case "ready-for-review":
1012
+ return "Ready for review.";
1009
1013
  case "merge":
1010
1014
  return "Merge PR.";
1011
1015
  }
@@ -1021,6 +1025,8 @@ function gitActionExpansion(action, base) {
1021
1025
  return "Commit, push, then `gh pr create --web -R <origin-owner/name>`.";
1022
1026
  case "resolve-conflicts":
1023
1027
  return `Fetch the PR base${base ? ` (\`${base}\`)` : ""}, merge it into this branch, resolve conflicts carefully, then commit and push until the PR is mergeable.`;
1028
+ case "ready-for-review":
1029
+ return "This phrase is the explicit ask to mark this thread's draft pull request ready for review on GitHub (`gh pr ready -R <origin-owner/name>` or `gh pr ready`). Update title/body if the purpose drifted. Do not merge.";
1024
1030
  case "merge":
1025
1031
  return "This phrase is the explicit ask to 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.";
1026
1032
  }
@@ -4063,7 +4069,7 @@ async function adoptThread(input) {
4063
4069
  messages: input.messages ?? []
4064
4070
  });
4065
4071
  writeThread(thread);
4066
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-P66DGCZE.js");
4072
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-DR4UNOQC.js");
4067
4073
  await ensureWorkspace2(repoPath);
4068
4074
  const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-N5X5I422.js");
4069
4075
  await ensureWorktreeSideboardIgnored2(input.worktreePath);
@@ -5844,7 +5850,7 @@ function formatWorktreeDirective(thread, opts) {
5844
5850
  );
5845
5851
  }
5846
5852
  lines.push(
5847
- '- Sideboard git buttons send short phrases ("Commit and push.", "Merge PR.", \u2026) with their meaning attached \u2014 act on them without asking for clarification. If the user gives a goal (Greptile 5/5, CI green, until checks pass), you get the watch-fix-push playbook with that request.'
5853
+ '- Sideboard git buttons send short phrases ("Commit and push.", "Ready for review.", "Merge PR.", \u2026) with their meaning attached \u2014 act on them without asking for clarification. If the user gives a goal (Greptile 5/5, CI green, until checks pass), you get the watch-fix-push playbook with that request.'
5848
5854
  );
5849
5855
  lines.push("");
5850
5856
  lines.push(formatProcessGuideDirective({ worktreePath: thread.worktreePath }));
@@ -6339,7 +6345,7 @@ function formatScheduledPrompt(name, prompt) {
6339
6345
  ${prompt}`;
6340
6346
  }
6341
6347
  async function defaultDeps() {
6342
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-QSNGJ2ER.js");
6348
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-XAJ3LREM.js");
6343
6349
  const orch = getOrchestrator2();
6344
6350
  return {
6345
6351
  findThread: (id) => findThreadByRef(id),
@@ -6461,6 +6467,10 @@ async function waitForPidExit(pid, timeoutMs) {
6461
6467
  }
6462
6468
  return true;
6463
6469
  }
6470
+ function resolveSendFollowUp(thread, requested) {
6471
+ if (requested === "steer" || requested === "queue") return requested;
6472
+ return isOrchestratorThread(thread) ? followUpBehavior() : "queue";
6473
+ }
6464
6474
  var STALE_AGENT_PID_WAIT_MS = 2500;
6465
6475
  function writeLiveStatus(threadId, status, lastError) {
6466
6476
  const latest = readThread(threadId);
@@ -6926,13 +6936,13 @@ var Orchestrator = class {
6926
6936
  if (thread.status === "archived") {
6927
6937
  throw new Error(`Thread is archived: ${thread.id}`);
6928
6938
  }
6929
- const followUp = opts?.followUp === "steer" ? "steer" : "queue";
6930
6939
  let shouldSteer = false;
6931
6940
  const sent = await withThreadLock(thread.id, async () => {
6932
6941
  const current = this.requireThread(thread.id);
6933
6942
  if (current.status === "archived") {
6934
6943
  throw new Error(`Thread is archived: ${thread.id}`);
6935
6944
  }
6945
+ const followUp = resolveSendFollowUp(current, opts?.followUp);
6936
6946
  const queue = [...current.queue, prompt];
6937
6947
  this.crashContinued.delete(thread.id);
6938
6948
  this.jobContinueCount.delete(thread.id);
@@ -8257,7 +8267,7 @@ var Orchestrator = class {
8257
8267
  "ask_git targets a worktree agent thread (not the orchestrator). Pass a child/worktree thread ref."
8258
8268
  );
8259
8269
  }
8260
- if (action === "merge" && !thread.prUrl) {
8270
+ if ((action === "merge" || action === "ready-for-review") && !thread.prUrl) {
8261
8271
  throw new Error(
8262
8272
  "No pull request linked. Ask the worktree agent to open a draft PR first (ask_git create-draft)."
8263
8273
  );
@@ -8425,7 +8435,7 @@ var Orchestrator = class {
8425
8435
  this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
8426
8436
  if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
8427
8437
  try {
8428
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-P66DGCZE.js");
8438
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-DR4UNOQC.js");
8429
8439
  await ensureWorkspace2(thread.repoPath);
8430
8440
  } catch {
8431
8441
  }
@@ -8649,6 +8659,7 @@ export {
8649
8659
  LIVE_TURN_SPAWN_GRACE_MS,
8650
8660
  isPidAlive,
8651
8661
  waitForPidExit,
8662
+ resolveSendFollowUp,
8652
8663
  Orchestrator,
8653
8664
  getOrchestrator,
8654
8665
  startOrchestration
@@ -24,7 +24,7 @@ import {
24
24
  stripBrightsyNdjsonNoise,
25
25
  sumUsageList,
26
26
  toolDescription
27
- } from "./chunk-QTJ2ERA6.js";
27
+ } from "./chunk-NIB6BTC6.js";
28
28
  import {
29
29
  SLACK_REPLY_FORMATTING,
30
30
  addWorkspace,
@@ -47,7 +47,7 @@ import {
47
47
  stageAbsolutePathsAsAttachments,
48
48
  stageBuffersAsAttachments,
49
49
  syncWorkspacesFromThreads
50
- } from "./chunk-NA7P3SZL.js";
50
+ } from "./chunk-3ZFGZ7RT.js";
51
51
  import {
52
52
  addPrStackLayer,
53
53
  allocateTeamName,
@@ -129,6 +129,7 @@ import {
129
129
  assertOrchestratorCapableAgent,
130
130
  childEnvWithAppSettings,
131
131
  coerceOrchestratorAgent,
132
+ followUpBehavior,
132
133
  formatViewerContextDirective,
133
134
  formatViewerContextReminder,
134
135
  getIssueSource,
@@ -466,7 +467,7 @@ async function continueSourceThread(threadId, prompt) {
466
467
  await continueOnReply(threadId, prompt);
467
468
  return;
468
469
  }
469
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-PDEU75EE.js");
470
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-FTGAFZMK.js");
470
471
  await getOrchestrator2().send(threadId, prompt);
471
472
  } catch {
472
473
  }
@@ -800,9 +801,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
800
801
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
801
802
  );
802
803
  }
803
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-KPROJ54C.js");
804
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-3HIWNQ3B.js");
804
805
  if (isGlobalThread2(thread)) {
805
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-7OHKB5WV.js");
806
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-PRM5ARWG.js");
806
807
  ensureGlobalCoordinatorCwd2(
807
808
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
808
809
  );
@@ -997,6 +998,7 @@ var AGENT_GIT_ACTIONS = [
997
998
  "create-draft",
998
999
  "create-web",
999
1000
  "resolve-conflicts",
1001
+ "ready-for-review",
1000
1002
  "merge"
1001
1003
  ];
1002
1004
  function agentGitPrompt(action, opts) {
@@ -1012,6 +1014,8 @@ function agentGitPrompt(action, opts) {
1012
1014
  const named = base ? ` (${base})` : "";
1013
1015
  return `Merge the remote branch${named} into your branch and resolve conflicts. Then, commit and push your changes.`;
1014
1016
  }
1017
+ case "ready-for-review":
1018
+ return "Ready for review.";
1015
1019
  case "merge":
1016
1020
  return "Merge PR.";
1017
1021
  }
@@ -1027,6 +1031,8 @@ function gitActionExpansion(action, base) {
1027
1031
  return "Commit, push, then `gh pr create --web -R <origin-owner/name>`.";
1028
1032
  case "resolve-conflicts":
1029
1033
  return `Fetch the PR base${base ? ` (\`${base}\`)` : ""}, merge it into this branch, resolve conflicts carefully, then commit and push until the PR is mergeable.`;
1034
+ case "ready-for-review":
1035
+ return "This phrase is the explicit ask to mark this thread's draft pull request ready for review on GitHub (`gh pr ready -R <origin-owner/name>` or `gh pr ready`). Update title/body if the purpose drifted. Do not merge.";
1030
1036
  case "merge":
1031
1037
  return "This phrase is the explicit ask to 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.";
1032
1038
  }
@@ -3782,7 +3788,7 @@ async function createThread(input, _onSetupLine) {
3782
3788
  return readThread(thread.id) ?? thread;
3783
3789
  }
3784
3790
  async function listLinearIssues(agent, repoPath) {
3785
- const { getAdapter: getAdapter2 } = await import("./agents-AWSFDB47.js");
3791
+ const { getAdapter: getAdapter2 } = await import("./agents-544IX5KA.js");
3786
3792
  await requireAgent(agent, { requireLinear: true });
3787
3793
  const adapter = getAdapter2(agent);
3788
3794
  if (!adapter.listLinearIssues) {
@@ -4204,7 +4210,7 @@ async function adoptThread(input) {
4204
4210
  messages: input.messages ?? []
4205
4211
  });
4206
4212
  writeThread(thread);
4207
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-TEBTNS2M.js");
4213
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-ULHYXM4Y.js");
4208
4214
  await ensureWorkspace2(repoPath);
4209
4215
  const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-X54WSOXM.js");
4210
4216
  await ensureWorktreeSideboardIgnored2(input.worktreePath);
@@ -5998,7 +6004,7 @@ function formatWorktreeDirective(thread, opts) {
5998
6004
  );
5999
6005
  }
6000
6006
  lines.push(
6001
- '- Sideboard git buttons send short phrases ("Commit and push.", "Merge PR.", \u2026) with their meaning attached \u2014 act on them without asking for clarification. If the user gives a goal (Greptile 5/5, CI green, until checks pass), you get the watch-fix-push playbook with that request.'
6007
+ '- Sideboard git buttons send short phrases ("Commit and push.", "Ready for review.", "Merge PR.", \u2026) with their meaning attached \u2014 act on them without asking for clarification. If the user gives a goal (Greptile 5/5, CI green, until checks pass), you get the watch-fix-push playbook with that request.'
6002
6008
  );
6003
6009
  lines.push("");
6004
6010
  lines.push(formatProcessGuideDirective({ worktreePath: thread.worktreePath }));
@@ -6686,7 +6692,7 @@ function formatScheduledPrompt(name, prompt) {
6686
6692
  ${prompt}`;
6687
6693
  }
6688
6694
  async function defaultDeps() {
6689
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-PDEU75EE.js");
6695
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-FTGAFZMK.js");
6690
6696
  const orch = getOrchestrator2();
6691
6697
  return {
6692
6698
  findThread: (id) => findThreadByRef(id),
@@ -6808,6 +6814,10 @@ async function waitForPidExit(pid, timeoutMs) {
6808
6814
  }
6809
6815
  return true;
6810
6816
  }
6817
+ function resolveSendFollowUp(thread, requested) {
6818
+ if (requested === "steer" || requested === "queue") return requested;
6819
+ return isOrchestratorThread(thread) ? followUpBehavior() : "queue";
6820
+ }
6811
6821
  var STALE_AGENT_PID_WAIT_MS = 2500;
6812
6822
  function writeLiveStatus(threadId, status, lastError) {
6813
6823
  const latest = readThread(threadId);
@@ -7273,13 +7283,13 @@ var Orchestrator = class {
7273
7283
  if (thread.status === "archived") {
7274
7284
  throw new Error(`Thread is archived: ${thread.id}`);
7275
7285
  }
7276
- const followUp = opts?.followUp === "steer" ? "steer" : "queue";
7277
7286
  let shouldSteer = false;
7278
7287
  const sent = await withThreadLock(thread.id, async () => {
7279
7288
  const current = this.requireThread(thread.id);
7280
7289
  if (current.status === "archived") {
7281
7290
  throw new Error(`Thread is archived: ${thread.id}`);
7282
7291
  }
7292
+ const followUp = resolveSendFollowUp(current, opts?.followUp);
7283
7293
  const queue = [...current.queue, prompt];
7284
7294
  this.crashContinued.delete(thread.id);
7285
7295
  this.jobContinueCount.delete(thread.id);
@@ -8604,7 +8614,7 @@ var Orchestrator = class {
8604
8614
  "ask_git targets a worktree agent thread (not the orchestrator). Pass a child/worktree thread ref."
8605
8615
  );
8606
8616
  }
8607
- if (action === "merge" && !thread.prUrl) {
8617
+ if ((action === "merge" || action === "ready-for-review") && !thread.prUrl) {
8608
8618
  throw new Error(
8609
8619
  "No pull request linked. Ask the worktree agent to open a draft PR first (ask_git create-draft)."
8610
8620
  );
@@ -8772,7 +8782,7 @@ var Orchestrator = class {
8772
8782
  this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
8773
8783
  if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
8774
8784
  try {
8775
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-TEBTNS2M.js");
8785
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-ULHYXM4Y.js");
8776
8786
  await ensureWorkspace2(thread.repoPath);
8777
8787
  } catch {
8778
8788
  }
@@ -9190,6 +9200,7 @@ export {
9190
9200
  LIVE_TURN_SPAWN_GRACE_MS,
9191
9201
  isPidAlive,
9192
9202
  waitForPidExit,
9203
+ resolveSendFollowUp,
9193
9204
  Orchestrator,
9194
9205
  getOrchestrator,
9195
9206
  startOrchestration,
@@ -345,7 +345,7 @@ var COORDINATOR_TOOL_PLAYBOOK = [
345
345
  "Workspaces:",
346
346
  "- add_workspace / remove_workspace \u2014 register or unregister a git repo",
347
347
  "Worktree threads (chats):",
348
- "- create_thread \u2014 create a worktree + chat from branch | pr | ticket (appears on Home). Do not create a second worktree for a ticket, PR, or named branch that already has one \u2014 that call returns the live thread (alreadyStarted=true). Creating from the default branch still opens a new isolated worktree. Pass repoPath + parentThreadId; omit agent and model so Sideboard applies Settings \u2192 Default agent, model & effort (never pass your own agent or agent=cursor). If the repo has a setup script, Sideboard runs it in the background (does not block send_to_thread). Nested Codex (you are Codex and the child is Codex) deadlocks \u2014 omit agent; Sideboard coerces that case",
348
+ "- create_thread \u2014 create a worktree + chat from branch | pr | ticket (appears on Home). Do not create a second worktree for a ticket, PR, or named branch that already has one \u2014 that call returns the live thread (alreadyStarted=true). Creating from the default branch still opens a new isolated worktree. Pass repoPath + parentThreadId; omit agent and model so Sideboard applies Settings \u2192 Default agent, model & effort (never pass your own agent or agent=cursor). If the repo has a setup script, Sideboard runs it in the background (does not block send_to_thread). Nested Codex (you are Codex and the child would be Codex) can deadlock on ~/.codex locks \u2014 omit agent; Sideboard switches the child to Cursor when a CURSOR_API_KEY is set, otherwise keeps the Account default",
349
349
  "- start_board_card \u2014 same as create_thread for a ticket/PR/named branch (attaches issue text when resolvable). Then send_to_thread.",
350
350
  "- fork_worktree \u2014 fork a worktree chat into a NEW git worktree + chat (transcript attached); optional agent; leave model unset (Auto) unless you have a reason. Not for orchestration chats.",
351
351
  "- fork_chat \u2014 fork a worktree chat (same worktree tab) OR a Global orchestration chat (new orchestration tab); optional agent; leave model unset (Auto) unless you have a reason. Remote coordinators: use this to continue another orchestration chat on a different agent after session limits.",
@@ -360,9 +360,9 @@ var COORDINATOR_TOOL_PLAYBOOK = [
360
360
  "- get_diff \u2014 compact diff summary",
361
361
  "- get_pr_checks \u2014 snapshot of a worktree thread's PR checks (null = no PR). Use this to inspect status. If the user gave a goal, the worktree agent watches with `gh pr checks --watch` \u2014 do not poll for the human.",
362
362
  '- request_review \u2014 open a Review chat tab on a worktree thread (attaches .claude/skills/review/SKILL.md when present, else .context/review.md copied from .sideboard/review.md / stock; sends "Review changes in this workspace."); then wait_for_turn (loop while stillRunning) / get_turn_result on the returned id',
363
- "- ask_git \u2014 commit & push, open a draft PR, resolve conflicts, or merge. When the worktree is clean, Sideboard pushes / opens the PR itself. When dirty, it queues the worktree agent \u2014 then wait_for_turn (loop while stillRunning). Prefer this over paraphrasing. If ask_git / get_thread lastError says the GraphQL/PR body is too long, the branch is already pushed \u2014 send_to_thread so the worktree agent runs `gh pr create --body-file` with a short description. Do not invent SSH or auth failures from that error. If the user gave a goal (Greptile 5/5, CI green), send_to_thread that goal so the worktree agent enters the watch-fix-push loop \u2014 do not tell the human to poll.",
363
+ "- ask_git \u2014 commit & push, open a draft PR, mark ready for review, resolve conflicts, or merge. When the worktree is clean, Sideboard pushes / opens the PR itself. When dirty, it queues the worktree agent \u2014 then wait_for_turn (loop while stillRunning). Prefer this over paraphrasing. If ask_git / get_thread lastError says the GraphQL/PR body is too long, the branch is already pushed \u2014 send_to_thread so the worktree agent runs `gh pr create --body-file` with a short description. Do not invent SSH or auth failures from that error. If the user gave a goal (Greptile 5/5, CI green), send_to_thread that goal so the worktree agent enters the watch-fix-push loop \u2014 do not tell the human to poll.",
364
364
  '- Merge (`ask_git` action=merge / send_to_thread "Merge PR.") only when the user explicitly asked to merge that PR. Do not merge because the work looks done, CI is green, or a typical flow includes it.',
365
- '- Or send_to_thread with those exact phrases: "Commit and push.", "Commit, push, and open a draft PR.", "Merge the remote branch (main) into your branch and resolve conflicts. Then, commit and push your changes.", "Merge PR." (draft PRs: `gh pr create --draft -R <origin-owner/name>` using the workspace `github:` slug \u2014 never upstream). Never run git/gh from this orchestration cwd, and never merge the PR yourself.',
365
+ '- Or send_to_thread with those exact phrases: "Commit and push.", "Commit, push, and open a draft PR.", "Ready for review.", "Merge the remote branch (main) into your branch and resolve conflicts. Then, commit and push your changes.", "Merge PR." (draft PRs: `gh pr create --draft -R <origin-owner/name>` using the workspace `github:` slug \u2014 never upstream). Never run git/gh from this orchestration cwd, and never merge the PR yourself.',
366
366
  "Process guides:",
367
367
  "- Long child jobs (pack, test, deploy, anything that may run more than ~30s): workers always have `/long-running` (Sideboard product skill). Tell them to detach and wait; they may `stop_job` if it hangs or is doing the wrong thing; do not ask the human to poll.",
368
368
  "- Recurring multi-item / fan-out: if the child worktree has `.claude/skills/graph-engineering/SKILL.md`, tell the worker to follow it (`/graph-engineering`). Judge first; state on disk; grow the rulebook; do not patch three threads.",
@@ -487,7 +487,7 @@ function ensureGlobalCoordinatorCwd(opts) {
487
487
  "When creating threads, pass `repoPath` from `list_workspaces` (or the path you just registered).",
488
488
  orchId ? `Pass parentThreadId="${orchId}" (or omit it). Never invent another parentThreadId.` : "Pass `parentThreadId` for children (this chat's id from the turn reminder).",
489
489
  "Omit `agent` / `model` on `create_thread`. Sideboard applies Settings \u2192 Default agent, model & effort. Do not pass your own agent or `agent=cursor` \u2014 those are ignored.",
490
- "Never pass `agent=codex` when you yourself are Codex \u2014 nested Codex deadlocks on shared ~/.codex locks. Omit agent; Sideboard applies Account defaults (and coerces only that nested-Codex case).",
490
+ "Never pass `agent=codex` when you yourself are Codex \u2014 nested Codex can deadlock on shared ~/.codex locks. Omit agent; Sideboard applies Account defaults, and switches that nested-Codex case to Cursor only when a CURSOR_API_KEY is configured.",
491
491
  "Typical flow (Home board): list_board \u2192 create_thread (sourceType=ticket|pr|branch) \u2192 send_to_thread \u2192 wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft \u2192 wait_for_turn. Merge only if the user explicitly asked (`ask_git` merge).",
492
492
  "Typical flow (branch / explicit source): list_workspaces \u2192 list_branches|list_prs|list_issues \u2192 create_thread \u2192 send_to_thread \u2192 wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft.",
493
493
  "Typical flow (find work): list_workspaces \u2192 pick repo(s) matching account / project context \u2192 Sideboard list_issues / linear_* (tickets) or list_prs(queue=review) (reviews) \u2192 show the options. Never wait on Claude Linear MCP. Only create_thread + send_to_thread when they asked to start (e.g. \u201Cfind me work and start it\u201D) \u2014 then wait_for_turn (loop while stillRunning) \u2192 ask_git create-draft.",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isOrchestratorThread
3
- } from "./chunk-NA7P3SZL.js";
3
+ } from "./chunk-3ZFGZ7RT.js";
4
4
  import {
5
5
  codexUnattendedGitConfigArgs,
6
6
  mergeAgentGitAuthEnv,
@@ -1898,7 +1898,7 @@ var claudeAdapter = {
1898
1898
  );
1899
1899
  }
1900
1900
  const mode = permissionMode(thread);
1901
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-KPROJ54C.js");
1901
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-3HIWNQ3B.js");
1902
1902
  const isOrchestrator = isOrchestratorThread2(thread);
1903
1903
  const injectedServers = await buildInjectedMcpServers({
1904
1904
  includeSideboard: true,
@@ -2684,6 +2684,9 @@ function resolveCursorApiKey() {
2684
2684
  if (fromEnv) return fromEnv;
2685
2685
  return (loadAppSettings().environment.CURSOR_API_KEY || "").trim();
2686
2686
  }
2687
+ function isCursorApiKeyConfigured() {
2688
+ return Boolean(resolveCursorApiKey());
2689
+ }
2687
2690
  function isCursorAutoModel(model) {
2688
2691
  const id = (model ?? "").trim().toLowerCase();
2689
2692
  return !id || id === "default" || id === "auto";
@@ -3700,6 +3703,7 @@ export {
3700
3703
  userMcpNamesToDisable,
3701
3704
  listCodexModels,
3702
3705
  codexAdapter,
3706
+ isCursorApiKeyConfigured,
3703
3707
  isCursorAutoModel,
3704
3708
  resolveCursorModelId,
3705
3709
  listCursorModels,
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-Y4MIXGPA.js";
12
12
  import {
13
13
  isOrchestratorThread
14
- } from "./chunk-TNOLCU5B.js";
14
+ } from "./chunk-FJWQCZ74.js";
15
15
  import {
16
16
  codexUnattendedGitConfigArgs,
17
17
  mergeAgentGitAuthEnv,
@@ -2342,7 +2342,7 @@ var claudeAdapter = {
2342
2342
  );
2343
2343
  }
2344
2344
  const mode = permissionMode(thread);
2345
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-WSQNEALF.js");
2345
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-J737XNUX.js");
2346
2346
  const isOrchestrator = isOrchestratorThread2(thread);
2347
2347
  const injectedServers = await buildInjectedMcpServers({
2348
2348
  includeSideboard: true,
@@ -3337,6 +3337,9 @@ function resolveCursorApiKey() {
3337
3337
  if (fromEnv) return fromEnv;
3338
3338
  return (loadAppSettings().environment.CURSOR_API_KEY || "").trim();
3339
3339
  }
3340
+ function isCursorApiKeyConfigured() {
3341
+ return Boolean(resolveCursorApiKey());
3342
+ }
3340
3343
  function isCursorAutoModel(model) {
3341
3344
  const id = (model ?? "").trim().toLowerCase();
3342
3345
  return !id || id === "default" || id === "auto";
@@ -4327,6 +4330,7 @@ export {
4327
4330
  turnCostUsdFromCursorUsage,
4328
4331
  cursorSdkMessageToEvents,
4329
4332
  parseCursorRunnerLine,
4333
+ isCursorApiKeyConfigured,
4330
4334
  isCursorAutoModel,
4331
4335
  resolveCursorModelId,
4332
4336
  listCursorModels,
@@ -9,7 +9,7 @@ import {
9
9
  enrichWorkspacesWithGithub,
10
10
  ensureGlobalCoordinatorCwd,
11
11
  formatWorkspaceInventory
12
- } from "./chunk-TNOLCU5B.js";
12
+ } from "./chunk-FJWQCZ74.js";
13
13
  import "./chunk-7O53GXTA.js";
14
14
  import "./chunk-D6JWYJ4P.js";
15
15
  import "./chunk-LZQULFIT.js";
@@ -7,7 +7,7 @@ import {
7
7
  enrichWorkspacesWithGithub,
8
8
  ensureGlobalCoordinatorCwd,
9
9
  formatWorkspaceInventory
10
- } from "./chunk-NA7P3SZL.js";
10
+ } from "./chunk-3ZFGZ7RT.js";
11
11
  import "./chunk-7JIYKYLL.js";
12
12
  import "./chunk-6K64FJDD.js";
13
13
  import "./chunk-J7LQVLFQ.js";
@@ -15,7 +15,7 @@ import {
15
15
  orchestratorSessionPoisonedByBuiltins,
16
16
  slackCoordinatorSourceRef,
17
17
  takenTeamSlugsForOrchestration
18
- } from "./chunk-NA7P3SZL.js";
18
+ } from "./chunk-3ZFGZ7RT.js";
19
19
  import "./chunk-7JIYKYLL.js";
20
20
  import "./chunk-6K64FJDD.js";
21
21
  import "./chunk-J7LQVLFQ.js";
@@ -17,7 +17,7 @@ import {
17
17
  orchestratorSessionPoisonedByBuiltins,
18
18
  slackCoordinatorSourceRef,
19
19
  takenTeamSlugsForOrchestration
20
- } from "./chunk-TNOLCU5B.js";
20
+ } from "./chunk-FJWQCZ74.js";
21
21
  import "./chunk-7O53GXTA.js";
22
22
  import "./chunk-D6JWYJ4P.js";
23
23
  import "./chunk-LZQULFIT.js";