@sideboard-ai/core 0.1.92 → 0.1.96

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.
@@ -32,7 +32,7 @@ import {
32
32
  resolveCursorModelId,
33
33
  resolveLoginCommand,
34
34
  resolveQuotaFallbackAgent
35
- } from "./chunk-GJ2HJQIU.js";
35
+ } from "./chunk-WBX46OPD.js";
36
36
  import "./chunk-DKHGWYWR.js";
37
37
  import {
38
38
  ORCHESTRATOR_AGENT_KINDS,
@@ -28,7 +28,7 @@ import {
28
28
  resolveCursorModelId,
29
29
  resolveLoginCommand,
30
30
  resolveQuotaFallbackAgent
31
- } from "./chunk-35LKGGOC.js";
31
+ } from "./chunk-KWNUZ4LR.js";
32
32
  import {
33
33
  ORCHESTRATOR_AGENT_KINDS,
34
34
  assertOrchestratorCapableAgent,
@@ -766,6 +766,7 @@ function toCursorMcpServers(servers) {
766
766
  const env = mcpSpawnEnv(s.env);
767
767
  const launch = cursorSafeMcpLaunch(s.command, s.args);
768
768
  out[s.name] = {
769
+ type: "stdio",
769
770
  command: launch.command,
770
771
  ...launch.args && launch.args.length > 0 ? { args: launch.args } : {},
771
772
  ...env ? { env } : {}
@@ -958,6 +958,7 @@ function toCursorMcpServers(servers) {
958
958
  const env = mcpSpawnEnv(s.env);
959
959
  const launch = cursorSafeMcpLaunch(s.command, s.args);
960
960
  out[s.name] = {
961
+ type: "stdio",
961
962
  command: launch.command,
962
963
  ...launch.args && launch.args.length > 0 ? { args: launch.args } : {},
963
964
  ...env ? { env } : {}
package/dist/index.cjs CHANGED
@@ -6988,6 +6988,7 @@ function toCursorMcpServers(servers) {
6988
6988
  const env = mcpSpawnEnv(s.env);
6989
6989
  const launch = cursorSafeMcpLaunch(s.command, s.args);
6990
6990
  out[s.name] = {
6991
+ type: "stdio",
6991
6992
  command: launch.command,
6992
6993
  ...launch.args && launch.args.length > 0 ? { args: launch.args } : {},
6993
6994
  ...env ? { env } : {}
@@ -9325,7 +9326,6 @@ __export(index_exports, {
9325
9326
  SIDEBOARD_FORCE_STOP: () => SIDEBOARD_FORCE_STOP,
9326
9327
  SIDEBOARD_MCP_ALLOWED_TOOLS: () => SIDEBOARD_MCP_ALLOWED_TOOLS,
9327
9328
  SIDEBOARD_MCP_PROFILE_ENV: () => SIDEBOARD_MCP_PROFILE_ENV,
9328
- SLACK_LISTEN_BUSY_REPLY: () => SLACK_LISTEN_BUSY_REPLY,
9329
9329
  SLACK_LISTEN_STOPPED_REPLY: () => SLACK_LISTEN_STOPPED_REPLY,
9330
9330
  SLACK_LISTEN_TIMEOUT_REPLY: () => SLACK_LISTEN_TIMEOUT_REPLY,
9331
9331
  SLACK_OAUTH_CANCELLED: () => SLACK_OAUTH_CANCELLED,
@@ -9543,6 +9543,7 @@ __export(index_exports, {
9543
9543
  initializeGitRepository: () => initializeGitRepository,
9544
9544
  inspectGitWorktree: () => inspectGitWorktree,
9545
9545
  installAgent: () => installAgent,
9546
+ interruptSlackCoordinatorForInbound: () => interruptSlackCoordinatorForInbound,
9546
9547
  isAskUserToolName: () => isAskUserToolName,
9547
9548
  isBrightsyConnected: () => isBrightsyConnected,
9548
9549
  isBrightsyNdjsonLine: () => isBrightsyNdjsonLine,
@@ -11693,23 +11694,24 @@ async function countUnpushedCommits(worktreePath) {
11693
11694
  reject: false
11694
11695
  });
11695
11696
  const branch = head.stdout.trim();
11697
+ if (branch && branch !== "HEAD") {
11698
+ const remote = await git(
11699
+ ["rev-list", "--count", `origin/${branch}..HEAD`],
11700
+ worktreePath,
11701
+ { reject: false }
11702
+ );
11703
+ if (remote.exitCode === 0) {
11704
+ const n2 = Number(remote.stdout.trim());
11705
+ return Number.isFinite(n2) ? n2 : 0;
11706
+ }
11707
+ }
11696
11708
  const upstream = await git(
11697
11709
  ["rev-list", "--count", "@{upstream}..HEAD"],
11698
11710
  worktreePath,
11699
11711
  { reject: false }
11700
11712
  );
11701
- if (upstream.exitCode === 0) {
11702
- const n2 = Number(upstream.stdout.trim());
11703
- return Number.isFinite(n2) ? n2 : 0;
11704
- }
11705
- if (!branch || branch === "HEAD") return 0;
11706
- const remote = await git(
11707
- ["rev-list", "--count", `origin/${branch}..HEAD`],
11708
- worktreePath,
11709
- { reject: false }
11710
- );
11711
- if (remote.exitCode !== 0) return 0;
11712
- const n = Number(remote.stdout.trim());
11713
+ if (upstream.exitCode !== 0) return 0;
11714
+ const n = Number(upstream.stdout.trim());
11713
11715
  return Number.isFinite(n) ? n : 0;
11714
11716
  }
11715
11717
  function splitCombinedDiff(stdout) {
@@ -15417,6 +15419,11 @@ function isPidAlive(pid) {
15417
15419
  return false;
15418
15420
  }
15419
15421
  }
15422
+ function writeLiveStatus(threadId, status, lastError) {
15423
+ const latest = readThread(threadId);
15424
+ if (!latest || latest.status === "archived") return latest;
15425
+ return setStatus(threadId, status, lastError);
15426
+ }
15420
15427
  var Orchestrator = class {
15421
15428
  events = new import_node_events.EventEmitter();
15422
15429
  processes = /* @__PURE__ */ new Map();
@@ -15722,6 +15729,9 @@ var Orchestrator = class {
15722
15729
  }
15723
15730
  async send(threadRef, prompt) {
15724
15731
  const thread = this.requireThread(threadRef);
15732
+ if (thread.status === "archived") {
15733
+ throw new Error(`Thread is archived: ${thread.id}`);
15734
+ }
15725
15735
  return withThreadLock(thread.id, async () => {
15726
15736
  const current = this.requireThread(thread.id);
15727
15737
  const queue = [...current.queue, prompt];
@@ -15815,7 +15825,7 @@ var Orchestrator = class {
15815
15825
  break;
15816
15826
  }
15817
15827
  const thread = readThread(threadId);
15818
- if (!thread || thread.queue.length === 0) {
15828
+ if (!thread || thread.status === "archived" || thread.queue.length === 0) {
15819
15829
  if (thread && thread.status === "queued") {
15820
15830
  setStatus(threadId, "idle");
15821
15831
  this.emit({ type: "status_changed", threadId, status: "idle" });
@@ -15846,14 +15856,17 @@ var Orchestrator = class {
15846
15856
  }
15847
15857
  }
15848
15858
  async runTurn(threadId, prompt) {
15849
- let thread = this.requireThread(threadId);
15859
+ const existing = readThread(threadId);
15860
+ if (!existing || existing.status === "archived") return;
15861
+ let thread = existing;
15850
15862
  if (isGlobalThread(thread) && thread.sessionId && orchestratorSessionPoisonedByBuiltins(thread)) {
15851
15863
  thread = updateThread(threadId, { sessionId: null });
15852
15864
  }
15865
+ const running = writeLiveStatus(threadId, "running");
15866
+ if (!running || running.status !== "running") return;
15853
15867
  this.runningCount += 1;
15854
15868
  const turnStartedAt = Date.now();
15855
15869
  this.startingTurns.add(threadId);
15856
- setStatus(threadId, "running");
15857
15870
  this.emit({ type: "status_changed", threadId, status: "running" });
15858
15871
  this.emit({ type: "turn_started", threadId, prompt });
15859
15872
  try {
@@ -16124,8 +16137,8 @@ var Orchestrator = class {
16124
16137
  ts: (/* @__PURE__ */ new Date()).toISOString()
16125
16138
  });
16126
16139
  }
16127
- const afterTurn = this.requireThread(threadId);
16128
- if (afterTurn.planMode && afterTurn.worktreePath?.trim()) {
16140
+ const afterTurn = readThread(threadId);
16141
+ if (afterTurn && afterTurn.status !== "archived" && afterTurn.planMode && afterTurn.worktreePath?.trim()) {
16129
16142
  const presented = extractPresentedPlan(parts);
16130
16143
  const exited = parts.some(
16131
16144
  (p) => p.type === "tool" && /exitplanmode/i.test(p.name)
@@ -16138,29 +16151,34 @@ var Orchestrator = class {
16138
16151
  }
16139
16152
  }
16140
16153
  }
16141
- if (afterTurn.planMode && afterTurn.agent === "claude" && parts.some(
16154
+ if (afterTurn && afterTurn.status !== "archived" && afterTurn.planMode && afterTurn.agent === "claude" && parts.some(
16142
16155
  (p) => p.type === "tool" && /exitplanmode/i.test(p.name)
16143
16156
  )) {
16144
16157
  updateThread(threadId, { sessionId: null });
16145
16158
  }
16146
16159
  await syncThreadBranchFromGit(threadId);
16147
16160
  if (this.stoppedTurns.has(threadId)) {
16148
- setStatus(threadId, "stopped");
16149
- this.emit({ type: "status_changed", threadId, status: "stopped" });
16161
+ const stopped = writeLiveStatus(threadId, "stopped");
16162
+ if (stopped?.status === "stopped") {
16163
+ this.emit({ type: "status_changed", threadId, status: "stopped" });
16164
+ }
16150
16165
  this.emit({ type: "turn_finished", threadId, exitCode });
16151
16166
  } else {
16152
16167
  const failDetail = formatTurnExitError(exitCode, detail);
16153
16168
  const explainedInChat = exitCode !== 0 && Boolean(chatText) && (looksLikeAgentFailureMessage(chatText) || failDetail && chatText.includes(failDetail.replace(/^exit\s*\d+:\s*/i, "").trim()));
16154
- setStatus(
16169
+ const nextStatus = exitCode === 0 ? "idle" : "error";
16170
+ const written = writeLiveStatus(
16155
16171
  threadId,
16156
- exitCode === 0 ? "idle" : "error",
16172
+ nextStatus,
16157
16173
  exitCode === 0 || explainedInChat ? null : failDetail
16158
16174
  );
16159
- this.emit({
16160
- type: "status_changed",
16161
- threadId,
16162
- status: exitCode === 0 ? "idle" : "error"
16163
- });
16175
+ if (written && written.status !== "archived") {
16176
+ this.emit({
16177
+ type: "status_changed",
16178
+ threadId,
16179
+ status: written.status
16180
+ });
16181
+ }
16164
16182
  this.emit({ type: "turn_finished", threadId, exitCode });
16165
16183
  if (exitCode !== 0) {
16166
16184
  const blob = [chatText, detail].filter(Boolean).join("\n");
@@ -16171,13 +16189,17 @@ var Orchestrator = class {
16171
16189
  const message = err instanceof Error ? err.message : String(err);
16172
16190
  await syncThreadBranchFromGit(threadId).catch(() => void 0);
16173
16191
  if (this.stoppedTurns.has(threadId)) {
16174
- setStatus(threadId, "stopped");
16175
- this.emit({ type: "status_changed", threadId, status: "stopped" });
16192
+ const stopped = writeLiveStatus(threadId, "stopped");
16193
+ if (stopped?.status === "stopped") {
16194
+ this.emit({ type: "status_changed", threadId, status: "stopped" });
16195
+ }
16176
16196
  this.emit({ type: "turn_finished", threadId, exitCode: 1 });
16177
16197
  } else {
16178
- setStatus(threadId, "error", message);
16179
- this.emit({ type: "error", threadId, message });
16180
- this.emit({ type: "status_changed", threadId, status: "error" });
16198
+ const written = writeLiveStatus(threadId, "error", message);
16199
+ if (written?.status === "error") {
16200
+ this.emit({ type: "error", threadId, message });
16201
+ this.emit({ type: "status_changed", threadId, status: "error" });
16202
+ }
16181
16203
  this.emit({ type: "turn_finished", threadId, exitCode: 1 });
16182
16204
  void this.maybeHandleOrchestrationQuotaFailover(threadId, message);
16183
16205
  }
@@ -16224,9 +16246,11 @@ var Orchestrator = class {
16224
16246
  if (handle) handle.kill();
16225
16247
  const proc = this.processes.get(`${thread.id}:agent`);
16226
16248
  if (proc) proc.kill();
16227
- setStatus(thread.id, "stopped");
16228
- this.emit({ type: "status_changed", threadId: thread.id, status: "stopped" });
16229
- return this.requireThread(thread.id);
16249
+ const stopped = writeLiveStatus(thread.id, "stopped") ?? readThread(thread.id) ?? thread;
16250
+ if (stopped.status === "stopped") {
16251
+ this.emit({ type: "status_changed", threadId: thread.id, status: "stopped" });
16252
+ }
16253
+ return stopped;
16230
16254
  }
16231
16255
  async startDev(threadRef, scriptName) {
16232
16256
  const thread = this.requireThread(threadRef);
@@ -16462,11 +16486,21 @@ var Orchestrator = class {
16462
16486
  const off = this.on((event) => {
16463
16487
  if (event.type === "turn_finished" && event.threadId === thread.id) {
16464
16488
  off();
16465
- resolve(this.requireThread(thread.id));
16489
+ const latest = readThread(thread.id);
16490
+ if (!latest) {
16491
+ reject(new Error(`Thread not found: ${thread.id}`));
16492
+ return;
16493
+ }
16494
+ resolve(latest);
16466
16495
  }
16467
16496
  if (event.type === "error" && event.threadId === thread.id) {
16468
16497
  off();
16469
- resolve(this.requireThread(thread.id));
16498
+ const latest = readThread(thread.id);
16499
+ if (!latest) {
16500
+ reject(new Error(`Thread not found: ${thread.id}`));
16501
+ return;
16502
+ }
16503
+ resolve(latest);
16470
16504
  }
16471
16505
  });
16472
16506
  const timer = setInterval(() => {
@@ -16476,7 +16510,13 @@ var Orchestrator = class {
16476
16510
  reject(new Error("wait_for_turn timed out"));
16477
16511
  }
16478
16512
  const current = readThread(thread.id);
16479
- if (current && !["running", "queued"].includes(current.status)) {
16513
+ if (!current) {
16514
+ clearInterval(timer);
16515
+ off();
16516
+ reject(new Error(`Thread not found: ${thread.id}`));
16517
+ return;
16518
+ }
16519
+ if (!["running", "queued"].includes(current.status)) {
16480
16520
  clearInterval(timer);
16481
16521
  off();
16482
16522
  resolve(current);
@@ -19250,6 +19290,7 @@ function mergeSideboardIntoMcpServersJson(existing, sideboard) {
19250
19290
  const servers = asObject(root.mcpServers);
19251
19291
  const env = stripElectronSpawnEnv(sideboard.env);
19252
19292
  servers.sideboard = {
19293
+ type: "stdio",
19253
19294
  command: sideboard.command,
19254
19295
  ...sideboard.args && sideboard.args.length > 0 ? { args: sideboard.args } : {},
19255
19296
  ...env ? { env } : {}
@@ -20066,15 +20107,10 @@ function connectSession2(ws, opts, log) {
20066
20107
  }
20067
20108
 
20068
20109
  // src/slack/listen.ts
20069
- var SLACK_LISTEN_BUSY_REPLY = [
20070
- "Sideboard is busy with an in-progress turn.",
20071
- "I did not start a new request.",
20072
- 'Send "stop" to interrupt, or try again when idle.'
20073
- ].join(" ");
20074
20110
  var SLACK_LISTEN_STOPPED_REPLY = "Sideboard stopped the in-progress turn. Send another message when you want to continue.";
20075
20111
  var SLACK_LISTEN_TIMEOUT_REPLY = [
20076
20112
  "Sideboard timed out waiting for the local agent turn to finish.",
20077
- 'Send "stop" to interrupt, or try again.'
20113
+ 'Send another message to interrupt and retry, or send "stop".'
20078
20114
  ].join(" ");
20079
20115
  var handleChain = Promise.resolve();
20080
20116
  function enqueueHandle(fn) {
@@ -20088,6 +20124,30 @@ function enqueueHandle(fn) {
20088
20124
  function refreshWorkspaces2() {
20089
20125
  return getOrchestrator().listWorkspaces();
20090
20126
  }
20127
+ function slackInboundSuperseded(opts) {
20128
+ if (opts.inboundGeneration === void 0 || !opts.currentInboundGeneration) {
20129
+ return false;
20130
+ }
20131
+ return opts.currentInboundGeneration() !== opts.inboundGeneration;
20132
+ }
20133
+ function interruptSlackCoordinatorForInbound(msg, agent, log = () => void 0) {
20134
+ const userId = msg.userId?.trim();
20135
+ if (!userId) return false;
20136
+ try {
20137
+ const coordinator = ensureSlackCoordinator(msg.teamId, userId, agent);
20138
+ const fresh = readThread(coordinator.id) ?? coordinator;
20139
+ if (fresh.status !== "running" && fresh.status !== "queued") return false;
20140
+ getOrchestrator().stop(fresh.id, { clearQueue: true });
20141
+ log(
20142
+ `interrupt ${msg.kind} ${msg.ts} \u2192 coordinator ${fresh.id.slice(0, 8)} (${fresh.status})`
20143
+ );
20144
+ return true;
20145
+ } catch (err) {
20146
+ const errMsg = err instanceof Error ? err.message : String(err);
20147
+ log(`interrupt ${msg.ts}: ${errMsg}`);
20148
+ return false;
20149
+ }
20150
+ }
20091
20151
  function formatSlackInboundPrompt(msg) {
20092
20152
  const kind = msg.kind === "mention" ? "Slack @mention" : "Slack DM";
20093
20153
  return `${kind}
@@ -20116,7 +20176,7 @@ function slackReplyThreadTs(msg) {
20116
20176
  if (msg.kind === "mention") return msg.ts;
20117
20177
  return void 0;
20118
20178
  }
20119
- var SLACK_SEEN_REACTION = "+1";
20179
+ var SLACK_SEEN_REACTION = "eyes";
20120
20180
  function writeTokenForTeam(teamId) {
20121
20181
  const workspaces = listSlackWorkspacesRaw();
20122
20182
  const ws = workspaces.find((w) => w.team_id === teamId);
@@ -20218,7 +20278,13 @@ async function relayCoordinatorReplyToSlack(threadId, opts) {
20218
20278
  }
20219
20279
  async function handleSlackInbound(msg, opts) {
20220
20280
  const log = opts.onLog ?? (() => void 0);
20221
- await ackSlackInboundSeen(msg, opts);
20281
+ if (!opts.skipAck) {
20282
+ await ackSlackInboundSeen(msg, opts);
20283
+ }
20284
+ if (slackInboundSuperseded(opts)) {
20285
+ log(`skip superseded ${msg.kind} ${msg.ts}`);
20286
+ return;
20287
+ }
20222
20288
  const agent = coerceOrchestratorAgent(opts.agent ?? getDefaultAgent());
20223
20289
  const workspaces = refreshWorkspaces2();
20224
20290
  for (const ws of workspaces) {
@@ -20230,25 +20296,31 @@ async function handleSlackInbound(msg, opts) {
20230
20296
  log(`skip ${msg.kind} ${msg.ts}: missing Slack user id`);
20231
20297
  return;
20232
20298
  }
20299
+ if (slackInboundSuperseded(opts)) {
20300
+ log(`skip superseded ${msg.kind} ${msg.ts}`);
20301
+ return;
20302
+ }
20233
20303
  const coordinator = ensureSlackCoordinator(msg.teamId, userId, agent);
20234
- const fresh = readThread(coordinator.id) ?? coordinator;
20304
+ let fresh = readThread(coordinator.id) ?? coordinator;
20235
20305
  if (isSlackStopCommand(msg.text)) {
20236
20306
  try {
20237
- getOrchestrator().stop(fresh.id);
20307
+ getOrchestrator().stop(fresh.id, { clearQueue: true });
20238
20308
  log(`stop ${msg.kind} ${msg.ts} \u2192 coordinator ${fresh.id.slice(0, 8)}`);
20239
20309
  } catch (err) {
20240
20310
  const errMsg = err instanceof Error ? err.message : String(err);
20241
20311
  log(`stop ${msg.ts}: ${errMsg}`);
20242
20312
  }
20313
+ if (slackInboundSuperseded(opts)) {
20314
+ log(`skip superseded stop reply ${msg.ts}`);
20315
+ return;
20316
+ }
20243
20317
  await postSlackReply(msg, SLACK_LISTEN_STOPPED_REPLY, opts);
20244
20318
  log(`replied stopped ${msg.ts}`);
20245
20319
  return;
20246
20320
  }
20247
20321
  if (fresh.status === "running" || fresh.status === "queued") {
20248
- log(`busy ${msg.kind} ${msg.ts} \u2192 coordinator ${fresh.id.slice(0, 8)} (${fresh.status})`);
20249
- await postSlackReply(msg, SLACK_LISTEN_BUSY_REPLY, opts);
20250
- log(`replied busy ${msg.ts}`);
20251
- return;
20322
+ interruptSlackCoordinatorForInbound(msg, agent, log);
20323
+ fresh = readThread(coordinator.id) ?? coordinator;
20252
20324
  }
20253
20325
  log(
20254
20326
  `run ${msg.kind} ${msg.ts} user ${userId} \u2192 coordinator ${fresh.id.slice(0, 8)} (${inventory.length} workspace${inventory.length === 1 ? "" : "s"})`
@@ -20265,9 +20337,27 @@ async function handleSlackInbound(msg, opts) {
20265
20337
  try {
20266
20338
  await orch.send(fresh.id, prompt);
20267
20339
  await orch.waitForTurn(fresh.id, 14 * 60 * 1e3);
20340
+ if (slackInboundSuperseded(opts)) {
20341
+ log(`turn finished ${msg.ts} (superseded)`);
20342
+ return;
20343
+ }
20344
+ const after = readThread(fresh.id);
20345
+ if (!after || after.status === "stopped" || after.status === "archived") {
20346
+ log(`turn finished ${msg.ts} (interrupted, skip post)`);
20347
+ return;
20348
+ }
20268
20349
  reply = orch.getTurnResult(fresh.id).text.trim();
20269
20350
  } catch (err) {
20351
+ if (slackInboundSuperseded(opts)) {
20352
+ log(`turn error ${msg.ts} (superseded)`);
20353
+ return;
20354
+ }
20270
20355
  const errMsg = err instanceof Error ? err.message : String(err);
20356
+ const gone = /thread not found/i.test(errMsg);
20357
+ if (gone) {
20358
+ log(`turn finished ${msg.ts} (thread gone, skip post)`);
20359
+ return;
20360
+ }
20271
20361
  const timedOut = /timed out|timeout/i.test(errMsg);
20272
20362
  const errorReply = timedOut ? SLACK_LISTEN_TIMEOUT_REPLY : `Sideboard coordinator error: ${errMsg}`;
20273
20363
  await postSlackReply(msg, errorReply, opts).catch((postErr) => {
@@ -20314,19 +20404,35 @@ async function runSlackListen(opts = {}) {
20314
20404
  const log = opts.onLog ?? console.log;
20315
20405
  const connected = listSlackWorkspacesRaw();
20316
20406
  const orch = getOrchestrator();
20407
+ const agent = coerceOrchestratorAgent(opts.agent ?? getDefaultAgent());
20408
+ let inboundGeneration = 0;
20317
20409
  const off = orch.on((event) => {
20318
20410
  if (event.type !== "turn_finished") return;
20319
20411
  void relayCoordinatorReplyToSlack(event.threadId, opts);
20320
20412
  });
20321
- const onInbound = (msg) => enqueueHandle(async () => {
20413
+ const onInbound = (msg) => {
20322
20414
  if (!isInboundForThisDesktop(msg)) {
20323
20415
  log(
20324
20416
  `skip ${msg.kind} ${msg.ts}: Slack user ${msg.userId ?? "?"} is not connected on this Mac`
20325
20417
  );
20326
20418
  return;
20327
20419
  }
20328
- await handleSlackInbound(msg, opts);
20329
- });
20420
+ const generation = ++inboundGeneration;
20421
+ void ackSlackInboundSeen(msg, opts);
20422
+ interruptSlackCoordinatorForInbound(msg, agent, log);
20423
+ return enqueueHandle(async () => {
20424
+ if (generation !== inboundGeneration) {
20425
+ log(`skip superseded ${msg.kind} ${msg.ts}`);
20426
+ return;
20427
+ }
20428
+ await handleSlackInbound(msg, {
20429
+ ...opts,
20430
+ skipAck: true,
20431
+ inboundGeneration: generation,
20432
+ currentInboundGeneration: () => inboundGeneration
20433
+ });
20434
+ });
20435
+ };
20330
20436
  try {
20331
20437
  const relay = (opts.relayUrl ?? slackRelayUrl()).trim();
20332
20438
  if (!relay) {
@@ -20929,7 +21035,6 @@ async function startSlackRelayServer(opts) {
20929
21035
  SIDEBOARD_FORCE_STOP,
20930
21036
  SIDEBOARD_MCP_ALLOWED_TOOLS,
20931
21037
  SIDEBOARD_MCP_PROFILE_ENV,
20932
- SLACK_LISTEN_BUSY_REPLY,
20933
21038
  SLACK_LISTEN_STOPPED_REPLY,
20934
21039
  SLACK_LISTEN_TIMEOUT_REPLY,
20935
21040
  SLACK_OAUTH_CANCELLED,
@@ -21147,6 +21252,7 @@ async function startSlackRelayServer(opts) {
21147
21252
  initializeGitRepository,
21148
21253
  inspectGitWorktree,
21149
21254
  installAgent,
21255
+ interruptSlackCoordinatorForInbound,
21150
21256
  isAskUserToolName,
21151
21257
  isBrightsyConnected,
21152
21258
  isBrightsyNdjsonLine,
package/dist/index.d.cts CHANGED
@@ -1854,6 +1854,7 @@ type CursorTurnRequest = {
1854
1854
  * Must be passed on create and resume — Cursor does not persist them.
1855
1855
  */
1856
1856
  mcpServers?: Record<string, {
1857
+ type?: 'stdio';
1857
1858
  command: string;
1858
1859
  args?: string[];
1859
1860
  env?: Record<string, string>;
@@ -4241,7 +4242,6 @@ interface SlackSocketModeOptions {
4241
4242
  WebSocketImpl?: SlackWebSocketCtor;
4242
4243
  }
4243
4244
 
4244
- declare const SLACK_LISTEN_BUSY_REPLY: string;
4245
4245
  declare const SLACK_LISTEN_STOPPED_REPLY = "Sideboard stopped the in-progress turn. Send another message when you want to continue.";
4246
4246
  declare const SLACK_LISTEN_TIMEOUT_REPLY: string;
4247
4247
  interface SlackListenOptions {
@@ -4256,16 +4256,29 @@ interface SlackListenOptions {
4256
4256
  postReply?: (msg: SlackInboundMessage, text: string) => Promise<void>;
4257
4257
  /** Tests: ack reactions without talking to Slack Web API. */
4258
4258
  addReaction?: (msg: SlackInboundMessage, name: string) => Promise<void>;
4259
+ /**
4260
+ * Listen session token. After waitForTurn, skip posting if a newer inbound
4261
+ * superseded this turn (interrupt-and-replace).
4262
+ */
4263
+ inboundGeneration?: number;
4264
+ currentInboundGeneration?: () => number;
4265
+ /** Listen already acked; skip the eyes reaction in handleSlackInbound. */
4266
+ skipAck?: boolean;
4259
4267
  }
4268
+ /**
4269
+ * Kill an in-flight Slack coordinator turn so a follow-up can start immediately.
4270
+ * Same force-stop as MCP `send_to_thread` (`clearQueue: true`).
4271
+ */
4272
+ declare function interruptSlackCoordinatorForInbound(msg: SlackInboundMessage, agent: AgentKind, log?: (line: string) => void): boolean;
4260
4273
  declare function formatSlackInboundPrompt(msg: SlackInboundMessage): string;
4261
4274
  /**
4262
4275
  * Prefix Slack replies with This Mac's destination (`Work: …`) so a user with
4263
4276
  * more than one device can see who answered and address follow-ups the same way.
4264
4277
  */
4265
4278
  declare function formatSlackSignedReply(deviceLabel: string, text: string): string;
4266
- /** Slack emoji short name for “seen / got it”. */
4267
- declare const SLACK_SEEN_REACTION = "+1";
4268
- /** Thumbs-up the inbound message so Slack shows the bot saw it. */
4279
+ /** Slack emoji short name for “seen / looking at this”. */
4280
+ declare const SLACK_SEEN_REACTION = "eyes";
4281
+ /** Eyes-react the inbound message so Slack shows the bot saw it. */
4269
4282
  declare function ackSlackInboundSeen(msg: SlackInboundMessage, opts: Pick<SlackListenOptions, 'addReaction' | 'fetchImpl' | 'onLog'>): Promise<void>;
4270
4283
  declare function handleSlackInbound(msg: SlackInboundMessage, opts: SlackListenOptions): Promise<void>;
4271
4284
  /**
@@ -4450,4 +4463,4 @@ interface SlackRelayClientOptions {
4450
4463
  */
4451
4464
  declare function runSlackRelayClient(opts: SlackRelayClientOptions): Promise<void>;
4452
4465
 
4453
- export { AGENT_GIT_ACTIONS, ATTACHMENTS_DIR, type ActiveRun, type AddStackLayerInput, type AdoptInput, type AdvancedAppSettings, type AgentAdapter, type AgentEvent, type AgentGitAction, type AgentInstructionFile, type AgentKind, type AgentModelCatalog, type AgentModelInfo, type AgentSetupActionResult, type AgentSetupInfo, type AgentSetupKind, type AgentStatus, type AgentTurnInput, type AnthropicCacheControl, type AppSettings, type ApplyIntoMainResult, type AttachCommand, type Autonomy, BAKED_SLACK_RELAY_URL, BRIGHTSY_MCP_ALLOWED_TOOLS, type BranchInfo, type BrightsyAccount, type BrightsyChatTarget, type BrightsyChatTargets, type BrightsyCloudConnectAgent, type BrightsyHarnessSettings, type BrightsySession, BrightsySideboardApi, type BrightsyTeamTargets, CLAUDE_MODEL_CATALOG, CLOUD_COORDINATOR_BUSY_REPLY, CLOUD_COORDINATOR_STOPPED_REPLY, CLOUD_COORDINATOR_TIMEOUT_REPLY, CLOUD_ORCHESTRATOR_GOAL, CONTEXT_COMPACT_CHARS, CONTEXT_KEEP_RECENT_CHARS, CONTEXT_KEEP_RECENT_MESSAGES, CONTEXT_MIN_MESSAGES, CONVENTION_SETUP_RELPATHS, COORDINATOR_TOOL_PLAYBOOK, type CaffeinateHoldState, type ClaudeHarnessSettings, type CleanupOrphansResult, type CliAgentKind, type CliExecutableSettings, type CloudConnectAgent, type CloudConnectOptions, type CloudConnectStatus, type CompactResult, type CompactThresholds, type ComposerFileBuffer, type ConductorSettings, type ConductorWorkspace, type ConnectedBrightsyTeamInfo, type ConventionSetupFile, type CreateChatTabInput, type CreateGlobalChatOpts, type CreateStackInput, type CreateThreadInput, type CreateWorktreeResult, type CursorModelInfo, type CursorSdkStreamMessage, type CursorTurnRequest, type CursorWorktreesConfig, type DefaultsAppSettings, type DevServerHandle, type DiffCommentInput, type DiffCommentLine, type DiffCommit, type DiffFile, type DiffResult, type DiffScope, type DiffScopeStat, type ExpandResult, FAMOUS_SOCCER_TEAMS, type ForkChatTabInput, type ForkThreadWorktreeInput, type FormatGhLandErrorOptions, GITHUB_GIT_AUTH_MODES, GLOBAL_WORKSPACE_ID, type GetDiffOptions, type GhStackStatus, type GitHubStatus, type GitWorktreeStatus, type GithubGitAuthMode, HARNESS_ENV_KEYS, type HarnessId, type InitStackFromThreadInput, type IntegrationsSettings, type IpcApi, type IssueInfo, type IssueSource, LEGACY_ATTACHMENTS_DIR, LEGACY_PLAN_FILE_REL, LEGACY_REVIEW_REQUEST_PATH, LINEAR_OAUTH_CANCELLED, LINEAR_OAUTH_PORT, LINEAR_OAUTH_REDIRECT, LINEAR_OAUTH_SCOPES, type LandPreview, type LandResult, type LinearComment, type LinearIssue, LinearOAuthCancelledError, type LinearTeam, type LinearTeamsResult, type LinearWorkflowState, type ListIssuesResult, MAX_ANTHROPIC_CACHE_CONTROL_BLOCKS, type McpServerStatus, type MessagePart, ORCHESTRATOR_AGENT_KINDS, type OpenPrStackLayersInput, type OpenStackLayerInput, type OpenStackLayerResult, type OrchestrationQuotaOnLimit, Orchestrator, type OrchestratorAgentKind, type OrchestratorEvent, type OrchestratorRuntime, type OrphanWorktree, PASTE_ATTACH_MIN_CHARS, PASTE_ATTACH_MIN_LINES, PLAN_FILE_NAME, PLAN_FILE_REL, PLAN_MODE_INSTRUCTION, type PendingPlanQuestions, type PlanQuestion, type PlanQuestionAnswer, type PlanQuestionOption, type PlanToolPartLike, type PrActor, type PrCheckRun, type PrCommentInfo, type PrCommitInfo, type PrDetails, type PrInfo, type PrMeta, type PrReviewInfo, type PrStack, type PrStackLayer, type PresentedPlan, type PublicAppSettings, type PublicIntegrationsSettings, REPO_REVIEW_NAME, REPO_REVIEW_PATH, REVIEW_REQUEST_NAME, REVIEW_REQUEST_PATH, REVIEW_REQUEST_PREFILL, REVIEW_REQUEST_TEMPLATE, type RepoSettings, type RepoSetupInfo, type RequestReviewResult, type ResolvedReviewGuidelines, type ReviewGuidelinesSource, type RunMode, type RunScript, SIDEBOARD_FORCE_STOP, SIDEBOARD_MCP_ALLOWED_TOOLS, SIDEBOARD_MCP_PROFILE_ENV, SLACK_LISTEN_BUSY_REPLY, SLACK_LISTEN_STOPPED_REPLY, SLACK_LISTEN_TIMEOUT_REPLY, SLACK_OAUTH_CANCELLED, SLACK_OAUTH_REDIRECT, SLACK_REPLY_FORMATTING, SLACK_SEEN_REACTION, type ScriptHandle, type SetupRunResult, type SideboardMcpProfile, type SkillInfo, type SlackInboundMessage, type SlackListenOptions, type SlackListenStatus, SlackOAuthCancelledError, type SlackOutboundReply, type SlackOutboundWatch, type SlackRelayClientMessage, type SlackRelayClientOptions, SlackRelayHub, type SlackRelayServerHandle, type SlackRelayServerMessage, type SlackRelayServerOptions, type SlackReplyBadge, type SlackWorkspaceInfo, type SourceType, type SpawnTurnHandle, type SummarizeResult, THINKING_EFFORTS, type TeamName, type ThinkingEffort, type Thread, type ThreadAttachment, type ThreadMessage, type ThreadOptionsPatch, type ThreadStatus, type TokenUsage, type ToolPartLike, type TranscriptToolDetail, type TurnCommand, type UsageScope, type Workspace, type WorkspaceInventoryEntry, type WorkspaceScriptEnvOpts, ackSlackInboundSeen, addPrStackLayer, addStackLayerFromThread, addWorkspace, adoptThread, agentGitPrompt, allAdapters, allocatePort, allocatePortRange, allocateTeamName, allocateTeamSlug, appDataDir, appSettingsPath, appendIndexedGitConfig, appendMessage, applyAgentEvent, applyAppEnvironment, applyCompaction, applyGithubGitAuthEnv, applyThreadIntoMain, applyTurnUsage, assertOrchestratorCapableAgent, attachmentFromAbsolutePath, attachmentsFromBuffers, attachmentsFromWorktreePaths, attachmentsGitignoreBody, autoArchiveOnMergeEnabled, autoCleanupOrphansEnabled, autoRenameBranchEnabled, autoRunAfterSetupEnabled, branchDisplayLabel, brightsyAdapter, brightsyCloudConnectAgent, brightsyCloudConnectEnabled, brightsyConfigPath, brightsyInjectWorktreeMcpEnabled, brightsyMcpAllowedTools, brightsyMcpServerName, buildCachedUserContent, buildClaudeStreamJsonUserMessage, buildDiffCommentAttachment, buildForkTranscriptAttachment, buildPastedTextAttachment, buildReviewRequestAttachment, buildSessionSeed, buildWorkspaceScriptEnv, caffeinateHoldPath, caffeinateWhileCloudConnectEnabled, caffeinateWhileRunningEnabled, caffeinateWhileSlackListenEnabled, captureLoginEnv, captureTurnBaseline, checkoutPrStackLayer, childEnvWithAppSettings, claudeAdapter, claudeChromeEnabled, claudeUserSettingsPath, cleanupOrphanWorktrees, cloneRepoIntoSideboard, codexAdapter, codexSandboxWritableRootsArgs, codexUnattendedGitConfigArgs, coerceOrchestratorAgent, collectTakenTeamSlugs, commentLinearIssue, commitAll, conductorBundledBinDir, conductorDbPath, confirmLand, connectBrightsyTeam, connectSlackToken, contextTokens, coordinatorSystemPrompt, coordinatorTurnReminder, copyConfiguredFiles, countCacheControlBlocks, createChatTab, createEmptyThread, createExistingBranchWorktree, createGlobalChat, createLinearIssue, createLinearPkce, createOrUpdatePr, createPrStack, createThread, createThreadWorktree, currentBranch, cursorAdapter, cursorSdkMessageToEvents, decodeBrightsyTarget, deleteBranchOnPurgeEnabled, deleteThreadRecord, detectAgents, detectGhStack, detectLocalMergeConflicts, disconnectBrightsyTeam, disconnectLinear, disconnectLinearConnection, disconnectSlackWorkspace, discoverSkills, dismissSlackReplyBadge, dropCachedPrefixOnResume, encodeBrightsyTarget, enrichPathWithNpmGlobalBin, enrichWorkspacesWithGithub, ensureAgentPath, ensureCloudCoordinator, ensureGhPreferOrigin, ensureGlobalCoordinatorCwd, ensureReviewRequestFile, ensureSlackCoordinator, ensureSlackDeviceIdentity, ensureWorkspace, estimateMessageChars, estimateThreadChars, expandComposerPrompt, extractGhErrorDetail, extractPendingPlanQuestions, extractPresentedPlan, extractiveSummary, fetchPrHead, finalizeParts, findConventionSetup, findInvalidCacheControlTtlOrder, findOrphanWorktrees, findThreadByRef, findThreadForStackLayer, flattenTurnInput, forkChatTab, forkMessageSlice, forkThreadWorktree, formatAgentInstructions, formatArtifactDirective, formatBrightsyFetchError, formatFetchError, formatGhLandError, formatGitAuthModeDirective, formatIpcInvokeError, formatMergePrError, formatMessagesAsTranscript, formatPlanQuestionAnswers, formatPlanQuestionsForChat, formatProcessGuideDirective, formatRateLimitResetHint, formatRenameBranchDirective, formatSlackExternalReplyPrompt, formatSlackInboundPrompt, formatSlackRepliesForTurn, formatSlackSignedReply, formatTranscriptMarkdown, formatUiReminder, formatWorkspaceInventory, formatWorktreeDirective, formatWorktreeReminder, fromInclusiveInputUsage, getAdapter, getAgentSetupInfo, getBrightsySession, getCaffeinateHold, getDefaultAgent, getDefaultEffort, getDefaultFast, getDefaultModel, getDefaultRunScript, getDiff, getDiffSummary, getGitHubStatus, getGithubGitAuthMode, getGithubPat, getIssueSource, getLinearApiKey, getLinearAuthToken, getLinearIssue, getOrchestrator, getPr, getPrChecks, getPrDetails, getPrForHeadBranch, getPrMeta, getPrStack, getRepoSetupInfo, getRunMode, getRunScript, getSlackWorkspace, gh, ghHeadRef, ghRepoSelectArgs, git, githubAgentGitEnv, globalAgentCwd, handleSlackInbound, harnessEnvKey, hasBakedLinearOAuth, hasBakedSlackOAuth, hasConductorHook, hasConventionSetup, hasCursorWorktreeSetup, hasRepoHook, hasWorkspaceHook, healOrchestrationSoccerTitles, httpFetch, importConductorWorkspace, importConductorWorkspaceAsync, initPrStack, initStackFromThread, initializeGitRepository, inspectGitWorktree, installAgent, isAskUserToolName, isBrightsyConnected, isBrightsyNdjsonLine, isCloudCoordinatorThread, isConductorBundledCli, isCursorAutoModel, isDefaultishSourceRef, isDirty, isGhRateLimitError, isGlobalRepoPath, isGlobalThread, isImageFilePath, isInPrStack, isInboundForThisDesktop, isLinearConnected, isLinearOAuthCancelled, isOrchestratorCapableAgent, isOrchestratorThread, isPidAlive, isPlaceholderBranch, isPrNotMergeableError, isPresentPlanToolName, isSessionQuotaLimit, isSideboardScratchPath, isSlackCoordinatorThread, isSlackExternalReplyPrompt, isSlackOAuthCancelled, isThinkingEffort, isThreadCaffeinated, isWorkspaceScratchPath, linearAuthorizationHeader, linearGraphql, linearOAuthAuthorizeUrl, linearOAuthCredentials, listAgentSetupInfo, listBranchCommits, listBranches, listBrightsyAccounts, listBrightsyChatTargets, listCodexModels, listConductorWorkspaces, listConnectedBrightsyTeams, listCursorModels, listGitHubIssues, listGlobalThreads, listIssues, listLinearIssues, listLinearIssuesDirect, listLinearTeams, listModelsForAgent, listOpencodeModels, listPrs, listRunScripts, listSlackOutboundWatches, listSlackReplyBadges, listSlackWorkspaces, listThreads, listWorkspaces, listWorktreeFiles, listWorktrees, loadAgentInstructions, loadAppSettings, loadBrightsyConfig, loadConductorSettings, loadRepoSettings, loadWorkspaceSettings, locksDir, loginAgent, lookupSoccerTeam, maxConcurrentAgents, maybeCompactContext, mcpAllowTools, mcpAuthWarnings, mergeAgentGitAuthEnv, mergePr, mergePrStack, mergeSideboardIntoMcpServersJson, mergeUsage, nextPastedTextName, nextThinkingEffort, nonInteractiveGitProcessEnv, normalizeParseResult, normalizeThinkingEffort, normalizeThread, normalizeTurnInput, normalizeWorktreePath, openInSystemTerminal, openPrStackLayers, openStackLayer, opencodeAdapter, orchestrationQuotaFallbackAgent, orchestrationQuotaOnLimit, orchestrationTitleNeedsSoccerNickname, orchestratorSessionPoisonedByBuiltins, originGhRepoEnv, parseCursorRunnerLine, parseForceStopMessage, parseGhStackViewJson, parseGithubSlugFromRemoteUrl, parseMcpList, parsePlanQuestionsInput, parseSessionQuotaResetAt, parseSlackRelayClientMessage, parseSlackRelayServerMessage, partsToAssistantText, pastedTextStats, pendingSlackExternalReplies, permalinkForSlackReplyBadge, permissionMode, persistVaultKeyInKeychain, planFileAbs, posixShellSingleQuote, prepareTerminalCommand, previewLand, promptMentionsBrightsy, pushBranch, readExistingReviewRequestFile, readKeychainVaultKey, readPlanFile, readSkillBody, readThread, readWorktreeFile, readWorktreeFileForUpload, readWorktreeInclude, recordSlackOutboundWatch, refreshGitHubAuth, refreshSlackReplyBadges, registerPackagedUserMcpClients, releaseCaffeinateHoldForThread, removeWorkspace, removeWorktree, repoSlug, requestOccupancy, requestReview, requireAgent, resetGhStackDetectCache, resetGithubAgentTokenMemo, resolveAgentExecutable, resolveAgentGitAuthEnv, resolveClaudeExecutable, resolveCodexGitWritableRoots, resolveCommandBinarySync, resolveConductorCursorAgentId, resolveCursorModelId, resolveDefaultBranch, resolveDiffBaseRef, resolveEffectiveIssueSource, resolveFilesToCopy, resolveGhAuthToken, resolveGithubAgentToken, resolveGithubRepoSlug, resolveLinearState, resolveLinearTeam, resolveLoginCommand, resolveNewThreadOptions, resolvePlanMarkdown, resolvePrSelector, resolvePrSelectors, resolveQuotaFallbackAgent, resolveRepoRoot, resolveReviewGuidelines, resolveSlackListenMode, resolveThreadDefaults, resolveThreadEffort, resolveVaultKey, resolveWorktreeStartPoint, rewriteLinearError, run, runArchiveScript, runCloudConnect, runConventionSetup, runCursorWorktreeSetup, runSetupScript, runSlackListen, runSlackRelayClient, runWorkspaceSetup, sameWorktreePath, sanitizeMcpServerName, saveAppSettings, saveLinearOAuth, scrubGithubTokensFromChildEnv, secureFileUnlocksWith, setCaffeinateHold, setHttpFetchImpl, setStatus, setVaultMasterKey, settingsSourceLabel, shouldAttachPastedText, shouldCompactContext, shouldInjectBrightsyMcp, shouldRefreshReviewRequestTemplate, shouldRunWorktreeCleanup, sideboardHomeDir, sideboardMcpProfile, sideboardReposDir, sideboardWorkspacesDir, slackAppLevelToken, slackArchiveUrl, slackCoordinatorSourceRef, slackListenEnabled, slackOAuthCredentials, slackOAuthResultUrl, slackRelayUrl, slugify, spawnAgentTurn, splitForCompaction, stackAgentDefaultsFrom, stackIdFrom, stackMergeReadiness, stageAbsolutePathsAsAttachments, stageBuffersAsAttachments, startDevServer, startLinearOAuth, startMcpServer, startOrchestration, startSlackOAuth, startSlackRelayServer, stripBrightsyNdjsonNoise, stripNestedElectronEnv, submitPrStack, suggestSlug, summarizeConversation, switchBrightsyAccount, syncWorkspacesFromThreads, takenTeamSlugsForChatTab, takenTeamSlugsForOrchestration, taskMessageText, thinkingEffortBars, thinkingEffortLabel, threadDisplayLabel, threadFilePath, threadLockPath, threadRequestsBrightsyMcp, threadsDir, threadsSharingWorktree, toPublicAppSettings, toolDescription, toolDetail, toolFilePath, totalTokens, updateAdvancedSettings, updateAgentExecutable, updateAppEnvironment, updateBrightsySettings, updateClaudeSettings, updateCodexSettings, updateDefaultsSettings, updateIntegrationsSettings, updateLinearIssue, updateOpencodeSettings, updateThread, userClaudeMcpConfigPath, userCursorMcpConfigPath, validateLinearApiKey, warmGithubAgentAuth, withAgentInstructions, withExportedPath, withThreadLock, workspaceSettingsSourceLabel, worktreeCleanupSettings, worktreeDisplayLabel, worktreeDisplayLabelForGroup, worktreeNameFromPath, worktreesRoot, writeInjectedMcpConfig, writePlanFile, writeThread, writeWorktreeFile };
4466
+ export { AGENT_GIT_ACTIONS, ATTACHMENTS_DIR, type ActiveRun, type AddStackLayerInput, type AdoptInput, type AdvancedAppSettings, type AgentAdapter, type AgentEvent, type AgentGitAction, type AgentInstructionFile, type AgentKind, type AgentModelCatalog, type AgentModelInfo, type AgentSetupActionResult, type AgentSetupInfo, type AgentSetupKind, type AgentStatus, type AgentTurnInput, type AnthropicCacheControl, type AppSettings, type ApplyIntoMainResult, type AttachCommand, type Autonomy, BAKED_SLACK_RELAY_URL, BRIGHTSY_MCP_ALLOWED_TOOLS, type BranchInfo, type BrightsyAccount, type BrightsyChatTarget, type BrightsyChatTargets, type BrightsyCloudConnectAgent, type BrightsyHarnessSettings, type BrightsySession, BrightsySideboardApi, type BrightsyTeamTargets, CLAUDE_MODEL_CATALOG, CLOUD_COORDINATOR_BUSY_REPLY, CLOUD_COORDINATOR_STOPPED_REPLY, CLOUD_COORDINATOR_TIMEOUT_REPLY, CLOUD_ORCHESTRATOR_GOAL, CONTEXT_COMPACT_CHARS, CONTEXT_KEEP_RECENT_CHARS, CONTEXT_KEEP_RECENT_MESSAGES, CONTEXT_MIN_MESSAGES, CONVENTION_SETUP_RELPATHS, COORDINATOR_TOOL_PLAYBOOK, type CaffeinateHoldState, type ClaudeHarnessSettings, type CleanupOrphansResult, type CliAgentKind, type CliExecutableSettings, type CloudConnectAgent, type CloudConnectOptions, type CloudConnectStatus, type CompactResult, type CompactThresholds, type ComposerFileBuffer, type ConductorSettings, type ConductorWorkspace, type ConnectedBrightsyTeamInfo, type ConventionSetupFile, type CreateChatTabInput, type CreateGlobalChatOpts, type CreateStackInput, type CreateThreadInput, type CreateWorktreeResult, type CursorModelInfo, type CursorSdkStreamMessage, type CursorTurnRequest, type CursorWorktreesConfig, type DefaultsAppSettings, type DevServerHandle, type DiffCommentInput, type DiffCommentLine, type DiffCommit, type DiffFile, type DiffResult, type DiffScope, type DiffScopeStat, type ExpandResult, FAMOUS_SOCCER_TEAMS, type ForkChatTabInput, type ForkThreadWorktreeInput, type FormatGhLandErrorOptions, GITHUB_GIT_AUTH_MODES, GLOBAL_WORKSPACE_ID, type GetDiffOptions, type GhStackStatus, type GitHubStatus, type GitWorktreeStatus, type GithubGitAuthMode, HARNESS_ENV_KEYS, type HarnessId, type InitStackFromThreadInput, type IntegrationsSettings, type IpcApi, type IssueInfo, type IssueSource, LEGACY_ATTACHMENTS_DIR, LEGACY_PLAN_FILE_REL, LEGACY_REVIEW_REQUEST_PATH, LINEAR_OAUTH_CANCELLED, LINEAR_OAUTH_PORT, LINEAR_OAUTH_REDIRECT, LINEAR_OAUTH_SCOPES, type LandPreview, type LandResult, type LinearComment, type LinearIssue, LinearOAuthCancelledError, type LinearTeam, type LinearTeamsResult, type LinearWorkflowState, type ListIssuesResult, MAX_ANTHROPIC_CACHE_CONTROL_BLOCKS, type McpServerStatus, type MessagePart, ORCHESTRATOR_AGENT_KINDS, type OpenPrStackLayersInput, type OpenStackLayerInput, type OpenStackLayerResult, type OrchestrationQuotaOnLimit, Orchestrator, type OrchestratorAgentKind, type OrchestratorEvent, type OrchestratorRuntime, type OrphanWorktree, PASTE_ATTACH_MIN_CHARS, PASTE_ATTACH_MIN_LINES, PLAN_FILE_NAME, PLAN_FILE_REL, PLAN_MODE_INSTRUCTION, type PendingPlanQuestions, type PlanQuestion, type PlanQuestionAnswer, type PlanQuestionOption, type PlanToolPartLike, type PrActor, type PrCheckRun, type PrCommentInfo, type PrCommitInfo, type PrDetails, type PrInfo, type PrMeta, type PrReviewInfo, type PrStack, type PrStackLayer, type PresentedPlan, type PublicAppSettings, type PublicIntegrationsSettings, REPO_REVIEW_NAME, REPO_REVIEW_PATH, REVIEW_REQUEST_NAME, REVIEW_REQUEST_PATH, REVIEW_REQUEST_PREFILL, REVIEW_REQUEST_TEMPLATE, type RepoSettings, type RepoSetupInfo, type RequestReviewResult, type ResolvedReviewGuidelines, type ReviewGuidelinesSource, type RunMode, type RunScript, SIDEBOARD_FORCE_STOP, SIDEBOARD_MCP_ALLOWED_TOOLS, SIDEBOARD_MCP_PROFILE_ENV, SLACK_LISTEN_STOPPED_REPLY, SLACK_LISTEN_TIMEOUT_REPLY, SLACK_OAUTH_CANCELLED, SLACK_OAUTH_REDIRECT, SLACK_REPLY_FORMATTING, SLACK_SEEN_REACTION, type ScriptHandle, type SetupRunResult, type SideboardMcpProfile, type SkillInfo, type SlackInboundMessage, type SlackListenOptions, type SlackListenStatus, SlackOAuthCancelledError, type SlackOutboundReply, type SlackOutboundWatch, type SlackRelayClientMessage, type SlackRelayClientOptions, SlackRelayHub, type SlackRelayServerHandle, type SlackRelayServerMessage, type SlackRelayServerOptions, type SlackReplyBadge, type SlackWorkspaceInfo, type SourceType, type SpawnTurnHandle, type SummarizeResult, THINKING_EFFORTS, type TeamName, type ThinkingEffort, type Thread, type ThreadAttachment, type ThreadMessage, type ThreadOptionsPatch, type ThreadStatus, type TokenUsage, type ToolPartLike, type TranscriptToolDetail, type TurnCommand, type UsageScope, type Workspace, type WorkspaceInventoryEntry, type WorkspaceScriptEnvOpts, ackSlackInboundSeen, addPrStackLayer, addStackLayerFromThread, addWorkspace, adoptThread, agentGitPrompt, allAdapters, allocatePort, allocatePortRange, allocateTeamName, allocateTeamSlug, appDataDir, appSettingsPath, appendIndexedGitConfig, appendMessage, applyAgentEvent, applyAppEnvironment, applyCompaction, applyGithubGitAuthEnv, applyThreadIntoMain, applyTurnUsage, assertOrchestratorCapableAgent, attachmentFromAbsolutePath, attachmentsFromBuffers, attachmentsFromWorktreePaths, attachmentsGitignoreBody, autoArchiveOnMergeEnabled, autoCleanupOrphansEnabled, autoRenameBranchEnabled, autoRunAfterSetupEnabled, branchDisplayLabel, brightsyAdapter, brightsyCloudConnectAgent, brightsyCloudConnectEnabled, brightsyConfigPath, brightsyInjectWorktreeMcpEnabled, brightsyMcpAllowedTools, brightsyMcpServerName, buildCachedUserContent, buildClaudeStreamJsonUserMessage, buildDiffCommentAttachment, buildForkTranscriptAttachment, buildPastedTextAttachment, buildReviewRequestAttachment, buildSessionSeed, buildWorkspaceScriptEnv, caffeinateHoldPath, caffeinateWhileCloudConnectEnabled, caffeinateWhileRunningEnabled, caffeinateWhileSlackListenEnabled, captureLoginEnv, captureTurnBaseline, checkoutPrStackLayer, childEnvWithAppSettings, claudeAdapter, claudeChromeEnabled, claudeUserSettingsPath, cleanupOrphanWorktrees, cloneRepoIntoSideboard, codexAdapter, codexSandboxWritableRootsArgs, codexUnattendedGitConfigArgs, coerceOrchestratorAgent, collectTakenTeamSlugs, commentLinearIssue, commitAll, conductorBundledBinDir, conductorDbPath, confirmLand, connectBrightsyTeam, connectSlackToken, contextTokens, coordinatorSystemPrompt, coordinatorTurnReminder, copyConfiguredFiles, countCacheControlBlocks, createChatTab, createEmptyThread, createExistingBranchWorktree, createGlobalChat, createLinearIssue, createLinearPkce, createOrUpdatePr, createPrStack, createThread, createThreadWorktree, currentBranch, cursorAdapter, cursorSdkMessageToEvents, decodeBrightsyTarget, deleteBranchOnPurgeEnabled, deleteThreadRecord, detectAgents, detectGhStack, detectLocalMergeConflicts, disconnectBrightsyTeam, disconnectLinear, disconnectLinearConnection, disconnectSlackWorkspace, discoverSkills, dismissSlackReplyBadge, dropCachedPrefixOnResume, encodeBrightsyTarget, enrichPathWithNpmGlobalBin, enrichWorkspacesWithGithub, ensureAgentPath, ensureCloudCoordinator, ensureGhPreferOrigin, ensureGlobalCoordinatorCwd, ensureReviewRequestFile, ensureSlackCoordinator, ensureSlackDeviceIdentity, ensureWorkspace, estimateMessageChars, estimateThreadChars, expandComposerPrompt, extractGhErrorDetail, extractPendingPlanQuestions, extractPresentedPlan, extractiveSummary, fetchPrHead, finalizeParts, findConventionSetup, findInvalidCacheControlTtlOrder, findOrphanWorktrees, findThreadByRef, findThreadForStackLayer, flattenTurnInput, forkChatTab, forkMessageSlice, forkThreadWorktree, formatAgentInstructions, formatArtifactDirective, formatBrightsyFetchError, formatFetchError, formatGhLandError, formatGitAuthModeDirective, formatIpcInvokeError, formatMergePrError, formatMessagesAsTranscript, formatPlanQuestionAnswers, formatPlanQuestionsForChat, formatProcessGuideDirective, formatRateLimitResetHint, formatRenameBranchDirective, formatSlackExternalReplyPrompt, formatSlackInboundPrompt, formatSlackRepliesForTurn, formatSlackSignedReply, formatTranscriptMarkdown, formatUiReminder, formatWorkspaceInventory, formatWorktreeDirective, formatWorktreeReminder, fromInclusiveInputUsage, getAdapter, getAgentSetupInfo, getBrightsySession, getCaffeinateHold, getDefaultAgent, getDefaultEffort, getDefaultFast, getDefaultModel, getDefaultRunScript, getDiff, getDiffSummary, getGitHubStatus, getGithubGitAuthMode, getGithubPat, getIssueSource, getLinearApiKey, getLinearAuthToken, getLinearIssue, getOrchestrator, getPr, getPrChecks, getPrDetails, getPrForHeadBranch, getPrMeta, getPrStack, getRepoSetupInfo, getRunMode, getRunScript, getSlackWorkspace, gh, ghHeadRef, ghRepoSelectArgs, git, githubAgentGitEnv, globalAgentCwd, handleSlackInbound, harnessEnvKey, hasBakedLinearOAuth, hasBakedSlackOAuth, hasConductorHook, hasConventionSetup, hasCursorWorktreeSetup, hasRepoHook, hasWorkspaceHook, healOrchestrationSoccerTitles, httpFetch, importConductorWorkspace, importConductorWorkspaceAsync, initPrStack, initStackFromThread, initializeGitRepository, inspectGitWorktree, installAgent, interruptSlackCoordinatorForInbound, isAskUserToolName, isBrightsyConnected, isBrightsyNdjsonLine, isCloudCoordinatorThread, isConductorBundledCli, isCursorAutoModel, isDefaultishSourceRef, isDirty, isGhRateLimitError, isGlobalRepoPath, isGlobalThread, isImageFilePath, isInPrStack, isInboundForThisDesktop, isLinearConnected, isLinearOAuthCancelled, isOrchestratorCapableAgent, isOrchestratorThread, isPidAlive, isPlaceholderBranch, isPrNotMergeableError, isPresentPlanToolName, isSessionQuotaLimit, isSideboardScratchPath, isSlackCoordinatorThread, isSlackExternalReplyPrompt, isSlackOAuthCancelled, isThinkingEffort, isThreadCaffeinated, isWorkspaceScratchPath, linearAuthorizationHeader, linearGraphql, linearOAuthAuthorizeUrl, linearOAuthCredentials, listAgentSetupInfo, listBranchCommits, listBranches, listBrightsyAccounts, listBrightsyChatTargets, listCodexModels, listConductorWorkspaces, listConnectedBrightsyTeams, listCursorModels, listGitHubIssues, listGlobalThreads, listIssues, listLinearIssues, listLinearIssuesDirect, listLinearTeams, listModelsForAgent, listOpencodeModels, listPrs, listRunScripts, listSlackOutboundWatches, listSlackReplyBadges, listSlackWorkspaces, listThreads, listWorkspaces, listWorktreeFiles, listWorktrees, loadAgentInstructions, loadAppSettings, loadBrightsyConfig, loadConductorSettings, loadRepoSettings, loadWorkspaceSettings, locksDir, loginAgent, lookupSoccerTeam, maxConcurrentAgents, maybeCompactContext, mcpAllowTools, mcpAuthWarnings, mergeAgentGitAuthEnv, mergePr, mergePrStack, mergeSideboardIntoMcpServersJson, mergeUsage, nextPastedTextName, nextThinkingEffort, nonInteractiveGitProcessEnv, normalizeParseResult, normalizeThinkingEffort, normalizeThread, normalizeTurnInput, normalizeWorktreePath, openInSystemTerminal, openPrStackLayers, openStackLayer, opencodeAdapter, orchestrationQuotaFallbackAgent, orchestrationQuotaOnLimit, orchestrationTitleNeedsSoccerNickname, orchestratorSessionPoisonedByBuiltins, originGhRepoEnv, parseCursorRunnerLine, parseForceStopMessage, parseGhStackViewJson, parseGithubSlugFromRemoteUrl, parseMcpList, parsePlanQuestionsInput, parseSessionQuotaResetAt, parseSlackRelayClientMessage, parseSlackRelayServerMessage, partsToAssistantText, pastedTextStats, pendingSlackExternalReplies, permalinkForSlackReplyBadge, permissionMode, persistVaultKeyInKeychain, planFileAbs, posixShellSingleQuote, prepareTerminalCommand, previewLand, promptMentionsBrightsy, pushBranch, readExistingReviewRequestFile, readKeychainVaultKey, readPlanFile, readSkillBody, readThread, readWorktreeFile, readWorktreeFileForUpload, readWorktreeInclude, recordSlackOutboundWatch, refreshGitHubAuth, refreshSlackReplyBadges, registerPackagedUserMcpClients, releaseCaffeinateHoldForThread, removeWorkspace, removeWorktree, repoSlug, requestOccupancy, requestReview, requireAgent, resetGhStackDetectCache, resetGithubAgentTokenMemo, resolveAgentExecutable, resolveAgentGitAuthEnv, resolveClaudeExecutable, resolveCodexGitWritableRoots, resolveCommandBinarySync, resolveConductorCursorAgentId, resolveCursorModelId, resolveDefaultBranch, resolveDiffBaseRef, resolveEffectiveIssueSource, resolveFilesToCopy, resolveGhAuthToken, resolveGithubAgentToken, resolveGithubRepoSlug, resolveLinearState, resolveLinearTeam, resolveLoginCommand, resolveNewThreadOptions, resolvePlanMarkdown, resolvePrSelector, resolvePrSelectors, resolveQuotaFallbackAgent, resolveRepoRoot, resolveReviewGuidelines, resolveSlackListenMode, resolveThreadDefaults, resolveThreadEffort, resolveVaultKey, resolveWorktreeStartPoint, rewriteLinearError, run, runArchiveScript, runCloudConnect, runConventionSetup, runCursorWorktreeSetup, runSetupScript, runSlackListen, runSlackRelayClient, runWorkspaceSetup, sameWorktreePath, sanitizeMcpServerName, saveAppSettings, saveLinearOAuth, scrubGithubTokensFromChildEnv, secureFileUnlocksWith, setCaffeinateHold, setHttpFetchImpl, setStatus, setVaultMasterKey, settingsSourceLabel, shouldAttachPastedText, shouldCompactContext, shouldInjectBrightsyMcp, shouldRefreshReviewRequestTemplate, shouldRunWorktreeCleanup, sideboardHomeDir, sideboardMcpProfile, sideboardReposDir, sideboardWorkspacesDir, slackAppLevelToken, slackArchiveUrl, slackCoordinatorSourceRef, slackListenEnabled, slackOAuthCredentials, slackOAuthResultUrl, slackRelayUrl, slugify, spawnAgentTurn, splitForCompaction, stackAgentDefaultsFrom, stackIdFrom, stackMergeReadiness, stageAbsolutePathsAsAttachments, stageBuffersAsAttachments, startDevServer, startLinearOAuth, startMcpServer, startOrchestration, startSlackOAuth, startSlackRelayServer, stripBrightsyNdjsonNoise, stripNestedElectronEnv, submitPrStack, suggestSlug, summarizeConversation, switchBrightsyAccount, syncWorkspacesFromThreads, takenTeamSlugsForChatTab, takenTeamSlugsForOrchestration, taskMessageText, thinkingEffortBars, thinkingEffortLabel, threadDisplayLabel, threadFilePath, threadLockPath, threadRequestsBrightsyMcp, threadsDir, threadsSharingWorktree, toPublicAppSettings, toolDescription, toolDetail, toolFilePath, totalTokens, updateAdvancedSettings, updateAgentExecutable, updateAppEnvironment, updateBrightsySettings, updateClaudeSettings, updateCodexSettings, updateDefaultsSettings, updateIntegrationsSettings, updateLinearIssue, updateOpencodeSettings, updateThread, userClaudeMcpConfigPath, userCursorMcpConfigPath, validateLinearApiKey, warmGithubAgentAuth, withAgentInstructions, withExportedPath, withThreadLock, workspaceSettingsSourceLabel, worktreeCleanupSettings, worktreeDisplayLabel, worktreeDisplayLabelForGroup, worktreeNameFromPath, worktreesRoot, writeInjectedMcpConfig, writePlanFile, writeThread, writeWorktreeFile };