@sideboard-ai/core 0.1.124 → 0.1.125

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.
@@ -364,26 +364,9 @@ function storePath3() {
364
364
  function watchId(teamId, channelId, ts) {
365
365
  return `${teamId}:${channelId}:${ts}`;
366
366
  }
367
- function badgeId(teamId, userId) {
368
- return `${teamId}:${userId}`;
369
- }
370
367
  function slackArchiveUrl(channelId, ts) {
371
368
  return `https://slack.com/archives/${channelId}/p${ts.replace(".", "")}`;
372
369
  }
373
- function initialsFromName(name) {
374
- const parts = name.trim().split(/\s+/).filter(Boolean);
375
- if (parts.length === 0) return "?";
376
- if (parts.length === 1) {
377
- const w = parts[0];
378
- return (w.slice(0, 2) || "?").toUpperCase();
379
- }
380
- return `${parts[0][0] ?? ""}${parts[parts.length - 1][0] ?? ""}`.toUpperCase();
381
- }
382
- function hueFromId(id) {
383
- let h = 0;
384
- for (const c of id) h = h * 31 + c.charCodeAt(0) >>> 0;
385
- return h % 360;
386
- }
387
370
  function tsNewer(a, b) {
388
371
  return Number(a) > Number(b);
389
372
  }
@@ -456,7 +439,7 @@ async function continueSourceThread(threadId, prompt) {
456
439
  await continueOnReply(threadId, prompt);
457
440
  return;
458
441
  }
459
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-JS3EHI4E.js");
442
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-HN3LYHFN.js");
460
443
  await getOrchestrator2().send(threadId, prompt);
461
444
  } catch {
462
445
  }
@@ -540,7 +523,6 @@ function recordSlackOutboundWatch(input) {
540
523
  sourceThreadId: input.sourceThreadId?.trim() || void 0,
541
524
  postedAt: (/* @__PURE__ */ new Date()).toISOString(),
542
525
  lastSeenTs: ts,
543
- unread: false,
544
526
  permalink: slackArchiveUrl(channelId, ts),
545
527
  injectedReplyTs: [],
546
528
  replies: []
@@ -627,49 +609,9 @@ async function fetchMessages(token, watch, fetchImpl) {
627
609
  }
628
610
  return out;
629
611
  }
630
- function listSlackReplyBadges() {
631
- const unread = readStore3().filter((w) => w.unread && w.replyUserId && w.permalink);
632
- const byUser = /* @__PURE__ */ new Map();
633
- for (const w of unread) {
634
- const id = badgeId(w.teamId, w.replyUserId);
635
- const prev = byUser.get(id);
636
- if (!prev || tsNewer(w.replyTs || "", prev.replyTs || "")) {
637
- byUser.set(id, w);
638
- }
639
- }
640
- return [...byUser.entries()].map(([id, w]) => {
641
- const userName = w.replyUserName || w.toLabel || "Slack";
642
- return {
643
- id,
644
- userId: w.replyUserId,
645
- userName,
646
- initials: initialsFromName(userName),
647
- hue: hueFromId(w.replyUserId),
648
- permalink: w.permalink || slackArchiveUrl(w.channelId, w.replyTs || w.ts),
649
- label: w.toLabel,
650
- preview: w.replyPreview,
651
- repliedAt: w.replyTs || w.postedAt
652
- };
653
- }).sort((a, b) => b.repliedAt.localeCompare(a.repliedAt));
654
- }
655
- function dismissSlackReplyBadge(badgeKey) {
656
- const key = badgeKey.trim();
657
- const watches = readStore3().map((w) => {
658
- if (!w.unread || !w.replyUserId) return w;
659
- if (badgeId(w.teamId, w.replyUserId) !== key) return w;
660
- return { ...w, unread: false };
661
- });
662
- writeStore2(watches);
663
- return listSlackReplyBadges();
664
- }
665
- function permalinkForSlackReplyBadge(badgeKey) {
666
- return listSlackReplyBadges().find((b) => b.id === badgeKey)?.permalink ?? null;
667
- }
668
- async function refreshSlackReplyBadges(opts) {
612
+ async function pollSlackOutboundWatches(opts) {
669
613
  const now = opts?.now ?? Date.now();
670
- if (!opts?.force && now - lastPollMs < POLL_INTERVAL_MS) {
671
- return listSlackReplyBadges();
672
- }
614
+ if (!opts?.force && now - lastPollMs < POLL_INTERVAL_MS) return;
673
615
  lastPollMs = now;
674
616
  const existing = readStore3();
675
617
  let watches = pruneWatches(existing, now);
@@ -690,9 +632,7 @@ async function refreshSlackReplyBadges(opts) {
690
632
  const injected = new Set(watch.injectedReplyTs ?? []);
691
633
  const collected = [...watch.replies ?? []];
692
634
  let lastSeenTs = watch.lastSeenTs;
693
- let latestUser;
694
635
  let latestName;
695
- let latestText = "";
696
636
  let latestPermalink = watch.permalink;
697
637
  let newlyInjected = 0;
698
638
  for (const msg of replies) {
@@ -718,9 +658,7 @@ async function refreshSlackReplyBadges(opts) {
718
658
  text: msg.text ?? ""
719
659
  };
720
660
  if (!collected.some((r) => r.ts === ts)) collected.push(reply);
721
- latestUser = user;
722
661
  latestName = replyUserName;
723
- latestText = reply.text;
724
662
  latestPermalink = permalink;
725
663
  if (injected.has(ts)) {
726
664
  lastSeenTs = ts;
@@ -751,11 +689,6 @@ async function refreshSlackReplyBadges(opts) {
751
689
  watches[i] = {
752
690
  ...watch,
753
691
  lastSeenTs,
754
- unread: true,
755
- replyUserId: latestUser,
756
- replyUserName: latestName,
757
- replyTs: lastSeenTs,
758
- replyPreview: latestText.slice(0, 140),
759
692
  permalink: latestPermalink,
760
693
  injectedReplyTs: [...injected],
761
694
  replies: collected.slice(-MAX_REPLIES_PER_WATCH)
@@ -763,7 +696,6 @@ async function refreshSlackReplyBadges(opts) {
763
696
  changed = true;
764
697
  }
765
698
  if (changed) writeStore2(watches);
766
- return listSlackReplyBadges();
767
699
  }
768
700
 
769
701
  // src/orchestrator/orchestrator.ts
@@ -5156,7 +5088,7 @@ function formatScheduledPrompt(name, prompt) {
5156
5088
  ${prompt}`;
5157
5089
  }
5158
5090
  async function defaultDeps() {
5159
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-JS3EHI4E.js");
5091
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-HN3LYHFN.js");
5160
5092
  const orch = getOrchestrator2();
5161
5093
  return {
5162
5094
  findThread: (id) => findThreadByRef(id),
@@ -7145,10 +7077,7 @@ export {
7145
7077
  formatSlackReplyContinuePrompt,
7146
7078
  listSlackOutboundWatches,
7147
7079
  recordSlackOutboundWatch,
7148
- listSlackReplyBadges,
7149
- dismissSlackReplyBadge,
7150
- permalinkForSlackReplyBadge,
7151
- refreshSlackReplyBadges,
7080
+ pollSlackOutboundWatches,
7152
7081
  applyPromptCacheTtlEnv,
7153
7082
  spawnAgentTurn,
7154
7083
  AGENT_GIT_ACTIONS,
@@ -303,26 +303,9 @@ function storePath3() {
303
303
  function watchId(teamId, channelId, ts) {
304
304
  return `${teamId}:${channelId}:${ts}`;
305
305
  }
306
- function badgeId(teamId, userId) {
307
- return `${teamId}:${userId}`;
308
- }
309
306
  function slackArchiveUrl(channelId, ts) {
310
307
  return `https://slack.com/archives/${channelId}/p${ts.replace(".", "")}`;
311
308
  }
312
- function initialsFromName(name) {
313
- const parts = name.trim().split(/\s+/).filter(Boolean);
314
- if (parts.length === 0) return "?";
315
- if (parts.length === 1) {
316
- const w = parts[0];
317
- return (w.slice(0, 2) || "?").toUpperCase();
318
- }
319
- return `${parts[0][0] ?? ""}${parts[parts.length - 1][0] ?? ""}`.toUpperCase();
320
- }
321
- function hueFromId(id) {
322
- let h = 0;
323
- for (const c of id) h = h * 31 + c.charCodeAt(0) >>> 0;
324
- return h % 360;
325
- }
326
309
  function tsNewer(a, b) {
327
310
  return Number(a) > Number(b);
328
311
  }
@@ -395,7 +378,7 @@ async function continueSourceThread(threadId, prompt) {
395
378
  await continueOnReply(threadId, prompt);
396
379
  return;
397
380
  }
398
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-VJQ5EWZZ.js");
381
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-FZYM7I42.js");
399
382
  await getOrchestrator2().send(threadId, prompt);
400
383
  } catch {
401
384
  }
@@ -479,7 +462,6 @@ function recordSlackOutboundWatch(input) {
479
462
  sourceThreadId: input.sourceThreadId?.trim() || void 0,
480
463
  postedAt: (/* @__PURE__ */ new Date()).toISOString(),
481
464
  lastSeenTs: ts,
482
- unread: false,
483
465
  permalink: slackArchiveUrl(channelId, ts),
484
466
  injectedReplyTs: [],
485
467
  replies: []
@@ -566,36 +548,9 @@ async function fetchMessages(token, watch, fetchImpl) {
566
548
  }
567
549
  return out;
568
550
  }
569
- function listSlackReplyBadges() {
570
- const unread = readStore3().filter((w) => w.unread && w.replyUserId && w.permalink);
571
- const byUser = /* @__PURE__ */ new Map();
572
- for (const w of unread) {
573
- const id = badgeId(w.teamId, w.replyUserId);
574
- const prev = byUser.get(id);
575
- if (!prev || tsNewer(w.replyTs || "", prev.replyTs || "")) {
576
- byUser.set(id, w);
577
- }
578
- }
579
- return [...byUser.entries()].map(([id, w]) => {
580
- const userName = w.replyUserName || w.toLabel || "Slack";
581
- return {
582
- id,
583
- userId: w.replyUserId,
584
- userName,
585
- initials: initialsFromName(userName),
586
- hue: hueFromId(w.replyUserId),
587
- permalink: w.permalink || slackArchiveUrl(w.channelId, w.replyTs || w.ts),
588
- label: w.toLabel,
589
- preview: w.replyPreview,
590
- repliedAt: w.replyTs || w.postedAt
591
- };
592
- }).sort((a, b) => b.repliedAt.localeCompare(a.repliedAt));
593
- }
594
- async function refreshSlackReplyBadges(opts) {
551
+ async function pollSlackOutboundWatches(opts) {
595
552
  const now = opts?.now ?? Date.now();
596
- if (!opts?.force && now - lastPollMs < POLL_INTERVAL_MS) {
597
- return listSlackReplyBadges();
598
- }
553
+ if (!opts?.force && now - lastPollMs < POLL_INTERVAL_MS) return;
599
554
  lastPollMs = now;
600
555
  const existing = readStore3();
601
556
  let watches = pruneWatches(existing, now);
@@ -616,9 +571,7 @@ async function refreshSlackReplyBadges(opts) {
616
571
  const injected = new Set(watch.injectedReplyTs ?? []);
617
572
  const collected = [...watch.replies ?? []];
618
573
  let lastSeenTs = watch.lastSeenTs;
619
- let latestUser;
620
574
  let latestName;
621
- let latestText = "";
622
575
  let latestPermalink = watch.permalink;
623
576
  let newlyInjected = 0;
624
577
  for (const msg of replies) {
@@ -644,9 +597,7 @@ async function refreshSlackReplyBadges(opts) {
644
597
  text: msg.text ?? ""
645
598
  };
646
599
  if (!collected.some((r) => r.ts === ts)) collected.push(reply);
647
- latestUser = user;
648
600
  latestName = replyUserName;
649
- latestText = reply.text;
650
601
  latestPermalink = permalink;
651
602
  if (injected.has(ts)) {
652
603
  lastSeenTs = ts;
@@ -677,11 +628,6 @@ async function refreshSlackReplyBadges(opts) {
677
628
  watches[i] = {
678
629
  ...watch,
679
630
  lastSeenTs,
680
- unread: true,
681
- replyUserId: latestUser,
682
- replyUserName: latestName,
683
- replyTs: lastSeenTs,
684
- replyPreview: latestText.slice(0, 140),
685
631
  permalink: latestPermalink,
686
632
  injectedReplyTs: [...injected],
687
633
  replies: collected.slice(-MAX_REPLIES_PER_WATCH)
@@ -689,7 +635,6 @@ async function refreshSlackReplyBadges(opts) {
689
635
  changed = true;
690
636
  }
691
637
  if (changed) writeStore(watches);
692
- return listSlackReplyBadges();
693
638
  }
694
639
 
695
640
  // src/orchestrator/orchestrator.ts
@@ -4985,7 +4930,7 @@ function formatScheduledPrompt(name, prompt) {
4985
4930
  ${prompt}`;
4986
4931
  }
4987
4932
  async function defaultDeps() {
4988
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-VJQ5EWZZ.js");
4933
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-FZYM7I42.js");
4989
4934
  const orch = getOrchestrator2();
4990
4935
  return {
4991
4936
  findThread: (id) => findThreadByRef(id),
@@ -6941,7 +6886,7 @@ export {
6941
6886
  requireSlackWorkspace,
6942
6887
  listSlackOutboundWatches,
6943
6888
  recordSlackOutboundWatch,
6944
- refreshSlackReplyBadges,
6889
+ pollSlackOutboundWatches,
6945
6890
  AGENT_GIT_ACTIONS,
6946
6891
  listLinearIssues,
6947
6892
  readTurnLive,
package/dist/index.cjs CHANGED
@@ -6185,26 +6185,9 @@ function storePath3() {
6185
6185
  function watchId(teamId, channelId, ts) {
6186
6186
  return `${teamId}:${channelId}:${ts}`;
6187
6187
  }
6188
- function badgeId(teamId, userId) {
6189
- return `${teamId}:${userId}`;
6190
- }
6191
6188
  function slackArchiveUrl(channelId, ts) {
6192
6189
  return `https://slack.com/archives/${channelId}/p${ts.replace(".", "")}`;
6193
6190
  }
6194
- function initialsFromName(name) {
6195
- const parts = name.trim().split(/\s+/).filter(Boolean);
6196
- if (parts.length === 0) return "?";
6197
- if (parts.length === 1) {
6198
- const w = parts[0];
6199
- return (w.slice(0, 2) || "?").toUpperCase();
6200
- }
6201
- return `${parts[0][0] ?? ""}${parts[parts.length - 1][0] ?? ""}`.toUpperCase();
6202
- }
6203
- function hueFromId(id) {
6204
- let h = 0;
6205
- for (const c of id) h = h * 31 + c.charCodeAt(0) >>> 0;
6206
- return h % 360;
6207
- }
6208
6191
  function tsNewer(a, b) {
6209
6192
  return Number(a) > Number(b);
6210
6193
  }
@@ -6360,7 +6343,6 @@ function recordSlackOutboundWatch(input) {
6360
6343
  sourceThreadId: input.sourceThreadId?.trim() || void 0,
6361
6344
  postedAt: (/* @__PURE__ */ new Date()).toISOString(),
6362
6345
  lastSeenTs: ts,
6363
- unread: false,
6364
6346
  permalink: slackArchiveUrl(channelId, ts),
6365
6347
  injectedReplyTs: [],
6366
6348
  replies: []
@@ -6447,49 +6429,9 @@ async function fetchMessages(token, watch, fetchImpl) {
6447
6429
  }
6448
6430
  return out;
6449
6431
  }
6450
- function listSlackReplyBadges() {
6451
- const unread = readStore3().filter((w) => w.unread && w.replyUserId && w.permalink);
6452
- const byUser = /* @__PURE__ */ new Map();
6453
- for (const w of unread) {
6454
- const id = badgeId(w.teamId, w.replyUserId);
6455
- const prev = byUser.get(id);
6456
- if (!prev || tsNewer(w.replyTs || "", prev.replyTs || "")) {
6457
- byUser.set(id, w);
6458
- }
6459
- }
6460
- return [...byUser.entries()].map(([id, w]) => {
6461
- const userName = w.replyUserName || w.toLabel || "Slack";
6462
- return {
6463
- id,
6464
- userId: w.replyUserId,
6465
- userName,
6466
- initials: initialsFromName(userName),
6467
- hue: hueFromId(w.replyUserId),
6468
- permalink: w.permalink || slackArchiveUrl(w.channelId, w.replyTs || w.ts),
6469
- label: w.toLabel,
6470
- preview: w.replyPreview,
6471
- repliedAt: w.replyTs || w.postedAt
6472
- };
6473
- }).sort((a, b) => b.repliedAt.localeCompare(a.repliedAt));
6474
- }
6475
- function dismissSlackReplyBadge(badgeKey) {
6476
- const key = badgeKey.trim();
6477
- const watches = readStore3().map((w) => {
6478
- if (!w.unread || !w.replyUserId) return w;
6479
- if (badgeId(w.teamId, w.replyUserId) !== key) return w;
6480
- return { ...w, unread: false };
6481
- });
6482
- writeStore2(watches);
6483
- return listSlackReplyBadges();
6484
- }
6485
- function permalinkForSlackReplyBadge(badgeKey) {
6486
- return listSlackReplyBadges().find((b) => b.id === badgeKey)?.permalink ?? null;
6487
- }
6488
- async function refreshSlackReplyBadges(opts) {
6432
+ async function pollSlackOutboundWatches(opts) {
6489
6433
  const now = opts?.now ?? Date.now();
6490
- if (!opts?.force && now - lastPollMs < POLL_INTERVAL_MS) {
6491
- return listSlackReplyBadges();
6492
- }
6434
+ if (!opts?.force && now - lastPollMs < POLL_INTERVAL_MS) return;
6493
6435
  lastPollMs = now;
6494
6436
  const existing = readStore3();
6495
6437
  let watches = pruneWatches(existing, now);
@@ -6510,9 +6452,7 @@ async function refreshSlackReplyBadges(opts) {
6510
6452
  const injected2 = new Set(watch.injectedReplyTs ?? []);
6511
6453
  const collected = [...watch.replies ?? []];
6512
6454
  let lastSeenTs = watch.lastSeenTs;
6513
- let latestUser;
6514
6455
  let latestName;
6515
- let latestText = "";
6516
6456
  let latestPermalink = watch.permalink;
6517
6457
  let newlyInjected = 0;
6518
6458
  for (const msg of replies) {
@@ -6538,9 +6478,7 @@ async function refreshSlackReplyBadges(opts) {
6538
6478
  text: msg.text ?? ""
6539
6479
  };
6540
6480
  if (!collected.some((r) => r.ts === ts)) collected.push(reply);
6541
- latestUser = user;
6542
6481
  latestName = replyUserName;
6543
- latestText = reply.text;
6544
6482
  latestPermalink = permalink;
6545
6483
  if (injected2.has(ts)) {
6546
6484
  lastSeenTs = ts;
@@ -6571,11 +6509,6 @@ async function refreshSlackReplyBadges(opts) {
6571
6509
  watches[i] = {
6572
6510
  ...watch,
6573
6511
  lastSeenTs,
6574
- unread: true,
6575
- replyUserId: latestUser,
6576
- replyUserName: latestName,
6577
- replyTs: lastSeenTs,
6578
- replyPreview: latestText.slice(0, 140),
6579
6512
  permalink: latestPermalink,
6580
6513
  injectedReplyTs: [...injected2],
6581
6514
  replies: collected.slice(-MAX_REPLIES_PER_WATCH)
@@ -6583,7 +6516,6 @@ async function refreshSlackReplyBadges(opts) {
6583
6516
  changed = true;
6584
6517
  }
6585
6518
  if (changed) writeStore2(watches);
6586
- return listSlackReplyBadges();
6587
6519
  }
6588
6520
  var import_node_fs18, import_node_path21, MAX_WATCHES, MAX_REPLIES_PER_WATCH, WATCH_TTL_MS, POLL_INTERVAL_MS, lastPollMs, nameCache, continueOnReply;
6589
6521
  var init_outbound_watch = __esm({
@@ -18038,7 +17970,6 @@ __export(index_exports, {
18038
17970
  disconnectLinearConnection: () => disconnectLinearConnection,
18039
17971
  disconnectSlackWorkspace: () => disconnectSlackWorkspace,
18040
17972
  discoverSkills: () => discoverSkills,
18041
- dismissSlackReplyBadge: () => dismissSlackReplyBadge,
18042
17973
  dropCachedPrefixOnResume: () => dropCachedPrefixOnResume,
18043
17974
  encodeBrightsyTarget: () => encodeBrightsyTarget,
18044
17975
  enrichPathWithNpmGlobalBin: () => enrichPathWithNpmGlobalBin,
@@ -18220,7 +18151,6 @@ __export(index_exports, {
18220
18151
  listRunScripts: () => listRunScripts,
18221
18152
  listSchedules: () => listSchedules,
18222
18153
  listSlackOutboundWatches: () => listSlackOutboundWatches,
18223
- listSlackReplyBadges: () => listSlackReplyBadges,
18224
18154
  listSlackWorkspaces: () => listSlackWorkspaces,
18225
18155
  listThreads: () => listThreads,
18226
18156
  listWorkspaces: () => listWorkspaces,
@@ -18276,10 +18206,10 @@ __export(index_exports, {
18276
18206
  partsToAssistantText: () => partsToAssistantText,
18277
18207
  pastedTextStats: () => pastedTextStats,
18278
18208
  pendingSlackExternalReplies: () => pendingSlackExternalReplies,
18279
- permalinkForSlackReplyBadge: () => permalinkForSlackReplyBadge,
18280
18209
  permissionMode: () => permissionMode,
18281
18210
  persistVaultKeyInKeychain: () => persistVaultKeyInKeychain,
18282
18211
  planFileAbs: () => planFileAbs,
18212
+ pollSlackOutboundWatches: () => pollSlackOutboundWatches,
18283
18213
  posixShellSingleQuote: () => posixShellSingleQuote,
18284
18214
  preferredCursorCostCents: () => preferredCursorCostCents,
18285
18215
  prepareTerminalCommand: () => prepareTerminalCommand,
@@ -18297,7 +18227,6 @@ __export(index_exports, {
18297
18227
  recordScheduleRun: () => recordScheduleRun,
18298
18228
  recordSlackOutboundWatch: () => recordSlackOutboundWatch,
18299
18229
  refreshGitHubAuth: () => refreshGitHubAuth,
18300
- refreshSlackReplyBadges: () => refreshSlackReplyBadges,
18301
18230
  registerPackagedUserMcpClients: () => registerPackagedUserMcpClients,
18302
18231
  releaseCaffeinateHoldForThread: () => releaseCaffeinateHoldForThread,
18303
18232
  releaseDesktopHost: () => releaseDesktopHost,
@@ -19926,7 +19855,7 @@ function registerSlackTools(server) {
19926
19855
  },
19927
19856
  async ({ team_id }) => {
19928
19857
  try {
19929
- await refreshSlackReplyBadges({ force: true });
19858
+ await pollSlackOutboundWatches({ force: true });
19930
19859
  const team = team_id?.trim();
19931
19860
  const watches = listSlackOutboundWatches().filter(
19932
19861
  (w) => !team || w.teamId === team
@@ -23804,7 +23733,6 @@ init_outbound_watch();
23804
23733
  disconnectLinearConnection,
23805
23734
  disconnectSlackWorkspace,
23806
23735
  discoverSkills,
23807
- dismissSlackReplyBadge,
23808
23736
  dropCachedPrefixOnResume,
23809
23737
  encodeBrightsyTarget,
23810
23738
  enrichPathWithNpmGlobalBin,
@@ -23986,7 +23914,6 @@ init_outbound_watch();
23986
23914
  listRunScripts,
23987
23915
  listSchedules,
23988
23916
  listSlackOutboundWatches,
23989
- listSlackReplyBadges,
23990
23917
  listSlackWorkspaces,
23991
23918
  listThreads,
23992
23919
  listWorkspaces,
@@ -24042,10 +23969,10 @@ init_outbound_watch();
24042
23969
  partsToAssistantText,
24043
23970
  pastedTextStats,
24044
23971
  pendingSlackExternalReplies,
24045
- permalinkForSlackReplyBadge,
24046
23972
  permissionMode,
24047
23973
  persistVaultKeyInKeychain,
24048
23974
  planFileAbs,
23975
+ pollSlackOutboundWatches,
24049
23976
  posixShellSingleQuote,
24050
23977
  preferredCursorCostCents,
24051
23978
  prepareTerminalCommand,
@@ -24063,7 +23990,6 @@ init_outbound_watch();
24063
23990
  recordScheduleRun,
24064
23991
  recordSlackOutboundWatch,
24065
23992
  refreshGitHubAuth,
24066
- refreshSlackReplyBadges,
24067
23993
  registerPackagedUserMcpClients,
24068
23994
  releaseCaffeinateHoldForThread,
24069
23995
  releaseDesktopHost,
package/dist/index.d.cts CHANGED
@@ -3706,95 +3706,6 @@ declare function getBrightsySession(): Promise<BrightsySession>;
3706
3706
  */
3707
3707
  declare function switchBrightsyAccount(accountIdOrSlug: string): Promise<BrightsySession>;
3708
3708
 
3709
- interface SlackOutboundReply {
3710
- userId: string;
3711
- userName: string;
3712
- ts: string;
3713
- text: string;
3714
- }
3715
- interface SlackOutboundWatch {
3716
- id: string;
3717
- teamId: string;
3718
- channelId: string;
3719
- /** Posted message ts. */
3720
- ts: string;
3721
- /** Parent thread ts (same as `ts` for top-level posts). */
3722
- threadTs: string;
3723
- kind: 'dm' | 'channel';
3724
- toUserId?: string;
3725
- toLabel: string;
3726
- ownerUserId?: string;
3727
- /** Sideboard orchestration thread that called slack_post. */
3728
- sourceThreadId?: string;
3729
- postedAt: string;
3730
- lastSeenTs: string;
3731
- unread: boolean;
3732
- replyUserId?: string;
3733
- replyUserName?: string;
3734
- replyTs?: string;
3735
- replyPreview?: string;
3736
- permalink?: string;
3737
- /** Reply timestamps already copied into the source thread (not commands). */
3738
- injectedReplyTs?: string[];
3739
- replies?: SlackOutboundReply[];
3740
- }
3741
- interface SlackReplyBadge {
3742
- id: string;
3743
- userId: string;
3744
- userName: string;
3745
- initials: string;
3746
- hue: number;
3747
- permalink: string;
3748
- label: string;
3749
- preview?: string;
3750
- repliedAt: string;
3751
- }
3752
- declare function slackArchiveUrl(channelId: string, ts: string): string;
3753
- declare function formatSlackExternalReplyPrompt(input: {
3754
- userName: string;
3755
- kind: 'dm' | 'channel';
3756
- toLabel: string;
3757
- text: string;
3758
- permalink?: string;
3759
- }): string;
3760
- declare function isSlackExternalReplyPrompt(text: string): boolean;
3761
- /**
3762
- * Slack replies appended after the last agent turn and before the current user
3763
- * prompt. CLI --resume does not see Sideboard-injected messages, so the next
3764
- * turn must include these in `prompt` (not cachedPrefix).
3765
- */
3766
- declare function pendingSlackExternalReplies(messages: Array<{
3767
- role: string;
3768
- text: string;
3769
- }>): string[];
3770
- declare function formatSlackRepliesForTurn(replies: string[]): string | null;
3771
- declare function formatSlackReplyContinuePrompt(input: {
3772
- userName: string;
3773
- kind: 'dm' | 'channel';
3774
- toLabel: string;
3775
- count: number;
3776
- }): string;
3777
- declare function listSlackOutboundWatches(): SlackOutboundWatch[];
3778
- declare function recordSlackOutboundWatch(input: {
3779
- teamId: string;
3780
- channelId: string;
3781
- ts: string;
3782
- threadTs?: string;
3783
- kind: 'dm' | 'channel';
3784
- toUserId?: string;
3785
- toLabel: string;
3786
- ownerUserId?: string;
3787
- sourceThreadId?: string;
3788
- }): SlackOutboundWatch | null;
3789
- declare function listSlackReplyBadges(): SlackReplyBadge[];
3790
- declare function dismissSlackReplyBadge(badgeKey: string): SlackReplyBadge[];
3791
- declare function permalinkForSlackReplyBadge(badgeKey: string): string | null;
3792
- declare function refreshSlackReplyBadges(opts?: {
3793
- fetchImpl?: typeof fetch;
3794
- force?: boolean;
3795
- now?: number;
3796
- }): Promise<SlackReplyBadge[]>;
3797
-
3798
3709
  interface SlackWorkspace {
3799
3710
  team_id: string;
3800
3711
  team_name: string;
@@ -3956,10 +3867,6 @@ interface IpcApi {
3956
3867
  onCaffeinateHoldChanged(listener: (state: CaffeinateHoldState & {
3957
3868
  appCaffeinated: boolean;
3958
3869
  }) => void): () => void;
3959
- /** Unread Slack replies to messages this Mac posted (relayed as info; queues a follow-up turn, not a Listen interrupt). */
3960
- getSlackReplyBadges(): Promise<SlackReplyBadge[]>;
3961
- /** Open the Slack thread in the browser/app and clear that user's badge. */
3962
- openSlackReply(badgeId: string): Promise<SlackReplyBadge[]>;
3963
3870
  /**
3964
3871
  * Unified issues for Create-from / Link issue (Linear API or GitHub Issues,
3965
3872
  * based on Account preference with Linear→GitHub fallback).
@@ -4811,4 +4718,74 @@ interface SlackRelayClientOptions {
4811
4718
  */
4812
4719
  declare function runSlackRelayClient(opts: SlackRelayClientOptions): Promise<void>;
4813
4720
 
4814
- export { AGENT_GIT_ACTIONS, AGENT_RUNNER_MAX_OLD_SPACE_MB, 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 CowboyThreadFields, type CreateChatTabInput, type CreateGlobalChatOpts, type CreateScheduledTaskInput, type CreateStackInput, type CreateThreadInput, type CreateWorktreeResult, type CursorAgentUsageSnapshot, type CursorModelInfo, type CursorSdkStreamMessage, type CursorTurnRequest, type CursorUsageCost, 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, REVIEW_SKILL_NAME, REVIEW_SKILL_PATH, type RepoSettings, type RepoSetupInfo, type RequestReviewResult, type ResolvedReviewGuidelines, type ReviewGuidelinesSource, type RunMode, type RunScript, SESSION_RESET_OCCUPANCY_TOKENS, 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_PROGRESS_DELAY_MS, SLACK_PROGRESS_EDIT_MS, SLACK_REPLY_FORMATTING, SLACK_SEEN_REACTION, type ScheduleCreatedBy, type ScheduleWhen, type ScheduledTask, 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 UpdateScheduledTaskPatch, type UsageScope, WORKTREE_MCP_TOOLS, type Workspace, type WorkspaceInventoryEntry, type WorkspaceScriptEnvOpts, ackSlackInboundSeen, addPrStackLayer, addStackLayerFromThread, addWorkspace, adoptThread, agentGitPrompt, allAdapters, allocatePort, allocatePortRange, allocateTeamName, allocateTeamSlug, appDataDir, appSettingsPath, appendIndexedGitConfig, appendMessage, applyAgentEvent, applyAgentRunnerHeapEnv, applyAppEnvironment, applyCompaction, applyGithubGitAuthEnv, applyPromptCacheTtlEnv, applyThreadIntoMain, applyTurnUsage, armSchedules, 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, caffeinateWhileSchedulesEnabled, caffeinateWhileSlackListenEnabled, captureLoginEnv, captureTurnBaseline, checkoutPrStackLayer, childEnvWithAppSettings, claimDesktopHost, claudeAdapter, claudeChromeEnabled, claudeUserSettingsPath, cleanupOrphanWorktrees, cloneRepoIntoSideboard, codexAdapter, codexSandboxWritableRootsArgs, codexUnattendedGitConfigArgs, coerceOrchestratorAgent, collectTakenTeamSlugs, commentLinearIssue, commitAll, computeNextRunAt, conductorBundledBinDir, conductorDbPath, confirmLand, connectBrightsyTeam, connectSlackToken, contextTokens, coordinatorSystemPrompt, coordinatorTurnReminder, copyConfiguredFiles, countCacheControlBlocks, cowboyModeEnabled, createChatTab, createEmptyThread, createExistingBranchWorktree, createGlobalChat, createLinearIssue, createLinearPkce, createOrUpdatePr, createPrStack, createSchedule, createThread, createThreadWorktree, currentBranch, cursorAdapter, cursorSdkMessageToEvents, decodeBrightsyTarget, defaultScheduleName, deleteBranchOnPurgeEnabled, deleteSchedule, deleteThreadRecord, desktopHostPidPath, detectAgents, detectGhStack, detectLocalMergeConflicts, disconnectBrightsyTeam, disconnectLinear, disconnectLinearConnection, disconnectSlackWorkspace, discoverSkills, dismissSlackReplyBadge, dropCachedPrefixOnResume, encodeBrightsyTarget, enrichPathWithNpmGlobalBin, enrichWorkspacesWithGithub, ensureAgentPath, ensureCloudCoordinator, ensureGhPreferOrigin, ensureGlobalCoordinatorCwd, ensureReviewRequestFile, ensureReviewSkillFile, ensureSlackCoordinator, ensureSlackDeviceIdentity, ensureWorkspace, estimateMessageChars, estimateThreadChars, expandComposerPrompt, extractGhErrorDetail, extractPendingPlanQuestions, extractPresentedPlan, extractiveSummary, fetchPrHead, finalizeParts, findConventionSetup, findInvalidCacheControlTtlOrder, findOrphanWorktrees, findSlackCoordinator, findThreadByRef, findThreadForStackLayer, fireSchedule, flattenTurnInput, forkChatTab, forkMessageSlice, forkThreadWorktree, formatAgentInstructions, formatArtifactDirective, formatBrightsyFetchError, formatFetchError, formatGhLandError, formatGitAuthModeDirective, formatIpcInvokeError, formatMergePrError, formatMessagesAsTranscript, formatPlanQuestionAnswers, formatPlanQuestionsForChat, formatProcessGuideDirective, formatRateLimitResetHint, formatRenameBranchDirective, formatScheduleWhen, formatScheduledPrompt, formatSlackExternalReplyPrompt, formatSlackInboundPrompt, formatSlackRepliesForTurn, formatSlackReplyContinuePrompt, formatSlackSignedReply, formatSlackWorkingText, 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, getSchedule, getSlackWorkspace, gh, ghHeadRef, ghRepoSelectArgs, git, githubAgentGitEnv, globalAgentCwd, handleSlackInbound, harnessEnvKey, hasBakedLinearOAuth, hasBakedSlackOAuth, hasConductorHook, hasConventionSetup, hasCursorWorktreeSetup, hasEnabledSchedules, hasRepoHook, hasWorkspaceHook, healOrchestrationSoccerTitles, httpFetch, importConductorWorkspace, importConductorWorkspaceAsync, initPrStack, initStackFromThread, initializeGitRepository, inspectGitWorktree, installAgent, interruptSlackCoordinatorForInbound, isAskUserToolName, isBrightsyConnected, isBrightsyNdjsonLine, isCloudCoordinatorThread, isConductorBundledCli, isCowboyThread, isCursorAutoModel, isDefaultishSourceRef, isDesktopHostAlive, isDirty, isGhRateLimitError, isGlobalRepoPath, isGlobalThread, isImageFilePath, isInPrStack, isInboundForThisDesktop, isLinearConnected, isLinearOAuthCancelled, isOrchestratorCapableAgent, isOrchestratorThread, isPidAlive, isPlaceholderBranch, isPollWrapperToolName, isPrNotMergeableError, isPresentPlanToolName, isPrimaryCheckoutThread, isSessionQuotaLimit, isShellToolName, isSideboardScratchPath, isSlackCoordinatorThread, isSlackExternalReplyPrompt, isSlackOAuthCancelled, isSubagentToolName, isThinkingEffort, isThisProcessDesktopHost, isThreadCaffeinated, isThreadRecordFile, isWorkspaceScratchPath, lastRequestOccupancy, linearAuthorizationHeader, linearGraphql, linearOAuthAuthorizeUrl, linearOAuthCredentials, listAgentSetupInfo, listBranchCommits, listBranches, listBrightsyAccounts, listBrightsyChatTargets, listCodexModels, listConductorWorkspaces, listConnectedBrightsyTeams, listCursorModels, listGitHubIssues, listGlobalThreads, listIssues, listLinearIssues, listLinearIssuesDirect, listLinearTeams, listModelsForAgent, listOpencodeModels, listPrs, listRunScripts, listSchedules, listSlackOutboundWatches, listSlackReplyBadges, listSlackWorkspaces, listThreads, listWorkspaces, listWorktreeFiles, listWorktrees, liveActivitySummary, loadAgentInstructions, loadAppSettings, loadBrightsyConfig, loadConductorSettings, loadRepoSettings, loadWorkspaceSettings, locksDir, loginAgent, lookupSoccerTeam, maxConcurrentAgents, maybeCompactContext, mcpAllowTools, mcpAuthWarnings, mergeAgentGitAuthEnv, mergePr, mergePrStack, mergeSideboardIntoMcpServersJson, mergeUsage, messagePartParentId, nextPastedTextName, nextThinkingEffort, nonInteractiveGitProcessEnv, normalizeParseResult, normalizeThinkingEffort, normalizeThread, normalizeTurnInput, normalizeWorktreePath, openInSystemTerminal, openPrStackLayers, openStackLayer, opencodeAdapter, orchestrationQuotaFallbackAgent, orchestrationQuotaOnLimit, orchestrationTitleNeedsSoccerNickname, orchestratorSessionPoisonedByBuiltins, originGhRepoEnv, parseCursorRunnerLine, parseDurationMs, parseForceStopMessage, parseGhStackViewJson, parseGithubSlugFromRemoteUrl, parseMcpList, parsePlanQuestionsInput, parseSessionQuotaResetAt, parseSlackRelayClientMessage, parseSlackRelayServerMessage, partsToAssistantText, pastedTextStats, pendingSlackExternalReplies, permalinkForSlackReplyBadge, permissionMode, persistVaultKeyInKeychain, planFileAbs, posixShellSingleQuote, preferredCursorCostCents, prepareTerminalCommand, previewLand, promptMentionsBrightsy, pushBranch, readExistingReviewRequestFile, readKeychainVaultKey, readPlanFile, readSkillBody, readThread, readWorktreeFile, readWorktreeFileForUpload, readWorktreeInclude, recordScheduleRun, recordSlackOutboundWatch, refreshGitHubAuth, refreshSlackReplyBadges, registerPackagedUserMcpClients, releaseCaffeinateHoldForThread, releaseDesktopHost, removeWorkspace, removeWorktree, repoSlug, requestOccupancy, requestReview, requireAgent, resetGhStackDetectCache, resetGithubAgentTokenMemo, resolveAgentExecutable, resolveAgentGitAuthEnv, resolveClaudeExecutable, resolveCodexGitWritableRoots, resolveCommandBinarySync, resolveConductorCursorAgentId, resolveCursorModelId, resolveDefaultBranch, resolveDiffBaseRef, resolveEffectiveIssueSource, resolveFilesToCopy, resolveGhAuthToken, resolveGitDirsForLockRecovery, resolveGithubAgentToken, resolveGithubRepoSlug, resolveLinearState, resolveLinearTeam, resolveLoginCommand, resolveNewThreadOptions, resolvePlanMarkdown, resolvePrSelector, resolvePrSelectors, resolveQuotaFallbackAgent, resolveRepoRoot, resolveReviewGuidelines, resolveScheduleThreadId, resolveSlackListenMode, resolveThreadDefaults, resolveThreadEffort, resolveVaultKey, resolveWorktreeStartPoint, rewriteLinearError, run, runArchiveScript, runCloudConnect, runConventionSetup, runCursorWorktreeSetup, runSetupScript, runSlackListen, runSlackRelayClient, runWorkspaceSetup, sameWorktreePath, sanitizeMcpServerName, saveAppSettings, saveLinearOAuth, schedulesPath, scrubGithubTokensFromChildEnv, secureFileUnlocksWith, setCaffeinateHold, setHttpFetchImpl, setStatus, setVaultMasterKey, settingsSourceLabel, shouldAttachPastedText, shouldCompactContext, shouldInjectBrightsyMcp, shouldRefreshReviewRequestTemplate, shouldRemoveWorktreeOnTeardown, shouldResetSessionForOccupancy, shouldRunWorktreeCleanup, showCostEnabled, 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, sumUsageList, summarizeConversation, switchBrightsyAccount, syncWorkspacesFromThreads, takenTeamSlugsForChatTab, takenTeamSlugsForOrchestration, taskMessageText, thinkingEffortBars, thinkingEffortLabel, thisProcessShouldDrainAgentQueues, threadDisplayLabel, threadFilePath, threadLivePath, threadLockPath, threadRequestsBrightsyMcp, threadsDir, threadsSharingWorktree, toPublicAppSettings, toolActivityLine, toolDescription, toolDetail, toolFilePath, totalTokens, turnCostUsdFromCursorUsage, updateAdvancedSettings, updateAgentExecutable, updateAppEnvironment, updateBrightsySettings, updateClaudeSettings, updateCodexSettings, updateDefaultsSettings, updateIntegrationsSettings, updateLinearIssue, updateOpencodeSettings, updateSchedule, updateThread, userClaudeMcpConfigPath, userCursorMcpConfigPath, validateLinearApiKey, waitForPidExit, warmGithubAgentAuth, withAgentInstructions, withEventParentId, withEventsParentId, withExportedPath, withMaxOldSpaceSize, withThreadLock, workspaceSettingsSourceLabel, worktreeCleanupSettings, worktreeDisplayLabel, worktreeDisplayLabelForGroup, worktreeNameFromPath, worktreesRoot, wrapReviewSkillMarkdown, writeInjectedMcpConfig, writePlanFile, writeThread, writeWorktreeFile };
4721
+ interface SlackOutboundReply {
4722
+ userId: string;
4723
+ userName: string;
4724
+ ts: string;
4725
+ text: string;
4726
+ }
4727
+ interface SlackOutboundWatch {
4728
+ id: string;
4729
+ teamId: string;
4730
+ channelId: string;
4731
+ /** Posted message ts. */
4732
+ ts: string;
4733
+ /** Parent thread ts (same as `ts` for top-level posts). */
4734
+ threadTs: string;
4735
+ kind: 'dm' | 'channel';
4736
+ toUserId?: string;
4737
+ toLabel: string;
4738
+ ownerUserId?: string;
4739
+ /** Sideboard orchestration thread that called slack_post. */
4740
+ sourceThreadId?: string;
4741
+ postedAt: string;
4742
+ lastSeenTs: string;
4743
+ permalink?: string;
4744
+ /** Reply timestamps already copied into the source thread (not commands). */
4745
+ injectedReplyTs?: string[];
4746
+ replies?: SlackOutboundReply[];
4747
+ }
4748
+ declare function slackArchiveUrl(channelId: string, ts: string): string;
4749
+ declare function formatSlackExternalReplyPrompt(input: {
4750
+ userName: string;
4751
+ kind: 'dm' | 'channel';
4752
+ toLabel: string;
4753
+ text: string;
4754
+ permalink?: string;
4755
+ }): string;
4756
+ declare function isSlackExternalReplyPrompt(text: string): boolean;
4757
+ /**
4758
+ * Slack replies appended after the last agent turn and before the current user
4759
+ * prompt. CLI --resume does not see Sideboard-injected messages, so the next
4760
+ * turn must include these in `prompt` (not cachedPrefix).
4761
+ */
4762
+ declare function pendingSlackExternalReplies(messages: Array<{
4763
+ role: string;
4764
+ text: string;
4765
+ }>): string[];
4766
+ declare function formatSlackRepliesForTurn(replies: string[]): string | null;
4767
+ declare function formatSlackReplyContinuePrompt(input: {
4768
+ userName: string;
4769
+ kind: 'dm' | 'channel';
4770
+ toLabel: string;
4771
+ count: number;
4772
+ }): string;
4773
+ declare function listSlackOutboundWatches(): SlackOutboundWatch[];
4774
+ declare function recordSlackOutboundWatch(input: {
4775
+ teamId: string;
4776
+ channelId: string;
4777
+ ts: string;
4778
+ threadTs?: string;
4779
+ kind: 'dm' | 'channel';
4780
+ toUserId?: string;
4781
+ toLabel: string;
4782
+ ownerUserId?: string;
4783
+ sourceThreadId?: string;
4784
+ }): SlackOutboundWatch | null;
4785
+ declare function pollSlackOutboundWatches(opts?: {
4786
+ fetchImpl?: typeof fetch;
4787
+ force?: boolean;
4788
+ now?: number;
4789
+ }): Promise<void>;
4790
+
4791
+ export { AGENT_GIT_ACTIONS, AGENT_RUNNER_MAX_OLD_SPACE_MB, 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 CowboyThreadFields, type CreateChatTabInput, type CreateGlobalChatOpts, type CreateScheduledTaskInput, type CreateStackInput, type CreateThreadInput, type CreateWorktreeResult, type CursorAgentUsageSnapshot, type CursorModelInfo, type CursorSdkStreamMessage, type CursorTurnRequest, type CursorUsageCost, 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, REVIEW_SKILL_NAME, REVIEW_SKILL_PATH, type RepoSettings, type RepoSetupInfo, type RequestReviewResult, type ResolvedReviewGuidelines, type ReviewGuidelinesSource, type RunMode, type RunScript, SESSION_RESET_OCCUPANCY_TOKENS, 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_PROGRESS_DELAY_MS, SLACK_PROGRESS_EDIT_MS, SLACK_REPLY_FORMATTING, SLACK_SEEN_REACTION, type ScheduleCreatedBy, type ScheduleWhen, type ScheduledTask, 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 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 UpdateScheduledTaskPatch, type UsageScope, WORKTREE_MCP_TOOLS, type Workspace, type WorkspaceInventoryEntry, type WorkspaceScriptEnvOpts, ackSlackInboundSeen, addPrStackLayer, addStackLayerFromThread, addWorkspace, adoptThread, agentGitPrompt, allAdapters, allocatePort, allocatePortRange, allocateTeamName, allocateTeamSlug, appDataDir, appSettingsPath, appendIndexedGitConfig, appendMessage, applyAgentEvent, applyAgentRunnerHeapEnv, applyAppEnvironment, applyCompaction, applyGithubGitAuthEnv, applyPromptCacheTtlEnv, applyThreadIntoMain, applyTurnUsage, armSchedules, 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, caffeinateWhileSchedulesEnabled, caffeinateWhileSlackListenEnabled, captureLoginEnv, captureTurnBaseline, checkoutPrStackLayer, childEnvWithAppSettings, claimDesktopHost, claudeAdapter, claudeChromeEnabled, claudeUserSettingsPath, cleanupOrphanWorktrees, cloneRepoIntoSideboard, codexAdapter, codexSandboxWritableRootsArgs, codexUnattendedGitConfigArgs, coerceOrchestratorAgent, collectTakenTeamSlugs, commentLinearIssue, commitAll, computeNextRunAt, conductorBundledBinDir, conductorDbPath, confirmLand, connectBrightsyTeam, connectSlackToken, contextTokens, coordinatorSystemPrompt, coordinatorTurnReminder, copyConfiguredFiles, countCacheControlBlocks, cowboyModeEnabled, createChatTab, createEmptyThread, createExistingBranchWorktree, createGlobalChat, createLinearIssue, createLinearPkce, createOrUpdatePr, createPrStack, createSchedule, createThread, createThreadWorktree, currentBranch, cursorAdapter, cursorSdkMessageToEvents, decodeBrightsyTarget, defaultScheduleName, deleteBranchOnPurgeEnabled, deleteSchedule, deleteThreadRecord, desktopHostPidPath, detectAgents, detectGhStack, detectLocalMergeConflicts, disconnectBrightsyTeam, disconnectLinear, disconnectLinearConnection, disconnectSlackWorkspace, discoverSkills, dropCachedPrefixOnResume, encodeBrightsyTarget, enrichPathWithNpmGlobalBin, enrichWorkspacesWithGithub, ensureAgentPath, ensureCloudCoordinator, ensureGhPreferOrigin, ensureGlobalCoordinatorCwd, ensureReviewRequestFile, ensureReviewSkillFile, ensureSlackCoordinator, ensureSlackDeviceIdentity, ensureWorkspace, estimateMessageChars, estimateThreadChars, expandComposerPrompt, extractGhErrorDetail, extractPendingPlanQuestions, extractPresentedPlan, extractiveSummary, fetchPrHead, finalizeParts, findConventionSetup, findInvalidCacheControlTtlOrder, findOrphanWorktrees, findSlackCoordinator, findThreadByRef, findThreadForStackLayer, fireSchedule, flattenTurnInput, forkChatTab, forkMessageSlice, forkThreadWorktree, formatAgentInstructions, formatArtifactDirective, formatBrightsyFetchError, formatFetchError, formatGhLandError, formatGitAuthModeDirective, formatIpcInvokeError, formatMergePrError, formatMessagesAsTranscript, formatPlanQuestionAnswers, formatPlanQuestionsForChat, formatProcessGuideDirective, formatRateLimitResetHint, formatRenameBranchDirective, formatScheduleWhen, formatScheduledPrompt, formatSlackExternalReplyPrompt, formatSlackInboundPrompt, formatSlackRepliesForTurn, formatSlackReplyContinuePrompt, formatSlackSignedReply, formatSlackWorkingText, 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, getSchedule, getSlackWorkspace, gh, ghHeadRef, ghRepoSelectArgs, git, githubAgentGitEnv, globalAgentCwd, handleSlackInbound, harnessEnvKey, hasBakedLinearOAuth, hasBakedSlackOAuth, hasConductorHook, hasConventionSetup, hasCursorWorktreeSetup, hasEnabledSchedules, hasRepoHook, hasWorkspaceHook, healOrchestrationSoccerTitles, httpFetch, importConductorWorkspace, importConductorWorkspaceAsync, initPrStack, initStackFromThread, initializeGitRepository, inspectGitWorktree, installAgent, interruptSlackCoordinatorForInbound, isAskUserToolName, isBrightsyConnected, isBrightsyNdjsonLine, isCloudCoordinatorThread, isConductorBundledCli, isCowboyThread, isCursorAutoModel, isDefaultishSourceRef, isDesktopHostAlive, isDirty, isGhRateLimitError, isGlobalRepoPath, isGlobalThread, isImageFilePath, isInPrStack, isInboundForThisDesktop, isLinearConnected, isLinearOAuthCancelled, isOrchestratorCapableAgent, isOrchestratorThread, isPidAlive, isPlaceholderBranch, isPollWrapperToolName, isPrNotMergeableError, isPresentPlanToolName, isPrimaryCheckoutThread, isSessionQuotaLimit, isShellToolName, isSideboardScratchPath, isSlackCoordinatorThread, isSlackExternalReplyPrompt, isSlackOAuthCancelled, isSubagentToolName, isThinkingEffort, isThisProcessDesktopHost, isThreadCaffeinated, isThreadRecordFile, isWorkspaceScratchPath, lastRequestOccupancy, linearAuthorizationHeader, linearGraphql, linearOAuthAuthorizeUrl, linearOAuthCredentials, listAgentSetupInfo, listBranchCommits, listBranches, listBrightsyAccounts, listBrightsyChatTargets, listCodexModels, listConductorWorkspaces, listConnectedBrightsyTeams, listCursorModels, listGitHubIssues, listGlobalThreads, listIssues, listLinearIssues, listLinearIssuesDirect, listLinearTeams, listModelsForAgent, listOpencodeModels, listPrs, listRunScripts, listSchedules, listSlackOutboundWatches, listSlackWorkspaces, listThreads, listWorkspaces, listWorktreeFiles, listWorktrees, liveActivitySummary, loadAgentInstructions, loadAppSettings, loadBrightsyConfig, loadConductorSettings, loadRepoSettings, loadWorkspaceSettings, locksDir, loginAgent, lookupSoccerTeam, maxConcurrentAgents, maybeCompactContext, mcpAllowTools, mcpAuthWarnings, mergeAgentGitAuthEnv, mergePr, mergePrStack, mergeSideboardIntoMcpServersJson, mergeUsage, messagePartParentId, nextPastedTextName, nextThinkingEffort, nonInteractiveGitProcessEnv, normalizeParseResult, normalizeThinkingEffort, normalizeThread, normalizeTurnInput, normalizeWorktreePath, openInSystemTerminal, openPrStackLayers, openStackLayer, opencodeAdapter, orchestrationQuotaFallbackAgent, orchestrationQuotaOnLimit, orchestrationTitleNeedsSoccerNickname, orchestratorSessionPoisonedByBuiltins, originGhRepoEnv, parseCursorRunnerLine, parseDurationMs, parseForceStopMessage, parseGhStackViewJson, parseGithubSlugFromRemoteUrl, parseMcpList, parsePlanQuestionsInput, parseSessionQuotaResetAt, parseSlackRelayClientMessage, parseSlackRelayServerMessage, partsToAssistantText, pastedTextStats, pendingSlackExternalReplies, permissionMode, persistVaultKeyInKeychain, planFileAbs, pollSlackOutboundWatches, posixShellSingleQuote, preferredCursorCostCents, prepareTerminalCommand, previewLand, promptMentionsBrightsy, pushBranch, readExistingReviewRequestFile, readKeychainVaultKey, readPlanFile, readSkillBody, readThread, readWorktreeFile, readWorktreeFileForUpload, readWorktreeInclude, recordScheduleRun, recordSlackOutboundWatch, refreshGitHubAuth, registerPackagedUserMcpClients, releaseCaffeinateHoldForThread, releaseDesktopHost, removeWorkspace, removeWorktree, repoSlug, requestOccupancy, requestReview, requireAgent, resetGhStackDetectCache, resetGithubAgentTokenMemo, resolveAgentExecutable, resolveAgentGitAuthEnv, resolveClaudeExecutable, resolveCodexGitWritableRoots, resolveCommandBinarySync, resolveConductorCursorAgentId, resolveCursorModelId, resolveDefaultBranch, resolveDiffBaseRef, resolveEffectiveIssueSource, resolveFilesToCopy, resolveGhAuthToken, resolveGitDirsForLockRecovery, resolveGithubAgentToken, resolveGithubRepoSlug, resolveLinearState, resolveLinearTeam, resolveLoginCommand, resolveNewThreadOptions, resolvePlanMarkdown, resolvePrSelector, resolvePrSelectors, resolveQuotaFallbackAgent, resolveRepoRoot, resolveReviewGuidelines, resolveScheduleThreadId, resolveSlackListenMode, resolveThreadDefaults, resolveThreadEffort, resolveVaultKey, resolveWorktreeStartPoint, rewriteLinearError, run, runArchiveScript, runCloudConnect, runConventionSetup, runCursorWorktreeSetup, runSetupScript, runSlackListen, runSlackRelayClient, runWorkspaceSetup, sameWorktreePath, sanitizeMcpServerName, saveAppSettings, saveLinearOAuth, schedulesPath, scrubGithubTokensFromChildEnv, secureFileUnlocksWith, setCaffeinateHold, setHttpFetchImpl, setStatus, setVaultMasterKey, settingsSourceLabel, shouldAttachPastedText, shouldCompactContext, shouldInjectBrightsyMcp, shouldRefreshReviewRequestTemplate, shouldRemoveWorktreeOnTeardown, shouldResetSessionForOccupancy, shouldRunWorktreeCleanup, showCostEnabled, 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, sumUsageList, summarizeConversation, switchBrightsyAccount, syncWorkspacesFromThreads, takenTeamSlugsForChatTab, takenTeamSlugsForOrchestration, taskMessageText, thinkingEffortBars, thinkingEffortLabel, thisProcessShouldDrainAgentQueues, threadDisplayLabel, threadFilePath, threadLivePath, threadLockPath, threadRequestsBrightsyMcp, threadsDir, threadsSharingWorktree, toPublicAppSettings, toolActivityLine, toolDescription, toolDetail, toolFilePath, totalTokens, turnCostUsdFromCursorUsage, updateAdvancedSettings, updateAgentExecutable, updateAppEnvironment, updateBrightsySettings, updateClaudeSettings, updateCodexSettings, updateDefaultsSettings, updateIntegrationsSettings, updateLinearIssue, updateOpencodeSettings, updateSchedule, updateThread, userClaudeMcpConfigPath, userCursorMcpConfigPath, validateLinearApiKey, waitForPidExit, warmGithubAgentAuth, withAgentInstructions, withEventParentId, withEventsParentId, withExportedPath, withMaxOldSpaceSize, withThreadLock, workspaceSettingsSourceLabel, worktreeCleanupSettings, worktreeDisplayLabel, worktreeDisplayLabelForGroup, worktreeNameFromPath, worktreesRoot, wrapReviewSkillMarkdown, writeInjectedMcpConfig, writePlanFile, writeThread, writeWorktreeFile };
package/dist/index.d.ts CHANGED
@@ -3706,95 +3706,6 @@ declare function getBrightsySession(): Promise<BrightsySession>;
3706
3706
  */
3707
3707
  declare function switchBrightsyAccount(accountIdOrSlug: string): Promise<BrightsySession>;
3708
3708
 
3709
- interface SlackOutboundReply {
3710
- userId: string;
3711
- userName: string;
3712
- ts: string;
3713
- text: string;
3714
- }
3715
- interface SlackOutboundWatch {
3716
- id: string;
3717
- teamId: string;
3718
- channelId: string;
3719
- /** Posted message ts. */
3720
- ts: string;
3721
- /** Parent thread ts (same as `ts` for top-level posts). */
3722
- threadTs: string;
3723
- kind: 'dm' | 'channel';
3724
- toUserId?: string;
3725
- toLabel: string;
3726
- ownerUserId?: string;
3727
- /** Sideboard orchestration thread that called slack_post. */
3728
- sourceThreadId?: string;
3729
- postedAt: string;
3730
- lastSeenTs: string;
3731
- unread: boolean;
3732
- replyUserId?: string;
3733
- replyUserName?: string;
3734
- replyTs?: string;
3735
- replyPreview?: string;
3736
- permalink?: string;
3737
- /** Reply timestamps already copied into the source thread (not commands). */
3738
- injectedReplyTs?: string[];
3739
- replies?: SlackOutboundReply[];
3740
- }
3741
- interface SlackReplyBadge {
3742
- id: string;
3743
- userId: string;
3744
- userName: string;
3745
- initials: string;
3746
- hue: number;
3747
- permalink: string;
3748
- label: string;
3749
- preview?: string;
3750
- repliedAt: string;
3751
- }
3752
- declare function slackArchiveUrl(channelId: string, ts: string): string;
3753
- declare function formatSlackExternalReplyPrompt(input: {
3754
- userName: string;
3755
- kind: 'dm' | 'channel';
3756
- toLabel: string;
3757
- text: string;
3758
- permalink?: string;
3759
- }): string;
3760
- declare function isSlackExternalReplyPrompt(text: string): boolean;
3761
- /**
3762
- * Slack replies appended after the last agent turn and before the current user
3763
- * prompt. CLI --resume does not see Sideboard-injected messages, so the next
3764
- * turn must include these in `prompt` (not cachedPrefix).
3765
- */
3766
- declare function pendingSlackExternalReplies(messages: Array<{
3767
- role: string;
3768
- text: string;
3769
- }>): string[];
3770
- declare function formatSlackRepliesForTurn(replies: string[]): string | null;
3771
- declare function formatSlackReplyContinuePrompt(input: {
3772
- userName: string;
3773
- kind: 'dm' | 'channel';
3774
- toLabel: string;
3775
- count: number;
3776
- }): string;
3777
- declare function listSlackOutboundWatches(): SlackOutboundWatch[];
3778
- declare function recordSlackOutboundWatch(input: {
3779
- teamId: string;
3780
- channelId: string;
3781
- ts: string;
3782
- threadTs?: string;
3783
- kind: 'dm' | 'channel';
3784
- toUserId?: string;
3785
- toLabel: string;
3786
- ownerUserId?: string;
3787
- sourceThreadId?: string;
3788
- }): SlackOutboundWatch | null;
3789
- declare function listSlackReplyBadges(): SlackReplyBadge[];
3790
- declare function dismissSlackReplyBadge(badgeKey: string): SlackReplyBadge[];
3791
- declare function permalinkForSlackReplyBadge(badgeKey: string): string | null;
3792
- declare function refreshSlackReplyBadges(opts?: {
3793
- fetchImpl?: typeof fetch;
3794
- force?: boolean;
3795
- now?: number;
3796
- }): Promise<SlackReplyBadge[]>;
3797
-
3798
3709
  interface SlackWorkspace {
3799
3710
  team_id: string;
3800
3711
  team_name: string;
@@ -3956,10 +3867,6 @@ interface IpcApi {
3956
3867
  onCaffeinateHoldChanged(listener: (state: CaffeinateHoldState & {
3957
3868
  appCaffeinated: boolean;
3958
3869
  }) => void): () => void;
3959
- /** Unread Slack replies to messages this Mac posted (relayed as info; queues a follow-up turn, not a Listen interrupt). */
3960
- getSlackReplyBadges(): Promise<SlackReplyBadge[]>;
3961
- /** Open the Slack thread in the browser/app and clear that user's badge. */
3962
- openSlackReply(badgeId: string): Promise<SlackReplyBadge[]>;
3963
3870
  /**
3964
3871
  * Unified issues for Create-from / Link issue (Linear API or GitHub Issues,
3965
3872
  * based on Account preference with Linear→GitHub fallback).
@@ -4811,4 +4718,74 @@ interface SlackRelayClientOptions {
4811
4718
  */
4812
4719
  declare function runSlackRelayClient(opts: SlackRelayClientOptions): Promise<void>;
4813
4720
 
4814
- export { AGENT_GIT_ACTIONS, AGENT_RUNNER_MAX_OLD_SPACE_MB, 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 CowboyThreadFields, type CreateChatTabInput, type CreateGlobalChatOpts, type CreateScheduledTaskInput, type CreateStackInput, type CreateThreadInput, type CreateWorktreeResult, type CursorAgentUsageSnapshot, type CursorModelInfo, type CursorSdkStreamMessage, type CursorTurnRequest, type CursorUsageCost, 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, REVIEW_SKILL_NAME, REVIEW_SKILL_PATH, type RepoSettings, type RepoSetupInfo, type RequestReviewResult, type ResolvedReviewGuidelines, type ReviewGuidelinesSource, type RunMode, type RunScript, SESSION_RESET_OCCUPANCY_TOKENS, 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_PROGRESS_DELAY_MS, SLACK_PROGRESS_EDIT_MS, SLACK_REPLY_FORMATTING, SLACK_SEEN_REACTION, type ScheduleCreatedBy, type ScheduleWhen, type ScheduledTask, 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 UpdateScheduledTaskPatch, type UsageScope, WORKTREE_MCP_TOOLS, type Workspace, type WorkspaceInventoryEntry, type WorkspaceScriptEnvOpts, ackSlackInboundSeen, addPrStackLayer, addStackLayerFromThread, addWorkspace, adoptThread, agentGitPrompt, allAdapters, allocatePort, allocatePortRange, allocateTeamName, allocateTeamSlug, appDataDir, appSettingsPath, appendIndexedGitConfig, appendMessage, applyAgentEvent, applyAgentRunnerHeapEnv, applyAppEnvironment, applyCompaction, applyGithubGitAuthEnv, applyPromptCacheTtlEnv, applyThreadIntoMain, applyTurnUsage, armSchedules, 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, caffeinateWhileSchedulesEnabled, caffeinateWhileSlackListenEnabled, captureLoginEnv, captureTurnBaseline, checkoutPrStackLayer, childEnvWithAppSettings, claimDesktopHost, claudeAdapter, claudeChromeEnabled, claudeUserSettingsPath, cleanupOrphanWorktrees, cloneRepoIntoSideboard, codexAdapter, codexSandboxWritableRootsArgs, codexUnattendedGitConfigArgs, coerceOrchestratorAgent, collectTakenTeamSlugs, commentLinearIssue, commitAll, computeNextRunAt, conductorBundledBinDir, conductorDbPath, confirmLand, connectBrightsyTeam, connectSlackToken, contextTokens, coordinatorSystemPrompt, coordinatorTurnReminder, copyConfiguredFiles, countCacheControlBlocks, cowboyModeEnabled, createChatTab, createEmptyThread, createExistingBranchWorktree, createGlobalChat, createLinearIssue, createLinearPkce, createOrUpdatePr, createPrStack, createSchedule, createThread, createThreadWorktree, currentBranch, cursorAdapter, cursorSdkMessageToEvents, decodeBrightsyTarget, defaultScheduleName, deleteBranchOnPurgeEnabled, deleteSchedule, deleteThreadRecord, desktopHostPidPath, detectAgents, detectGhStack, detectLocalMergeConflicts, disconnectBrightsyTeam, disconnectLinear, disconnectLinearConnection, disconnectSlackWorkspace, discoverSkills, dismissSlackReplyBadge, dropCachedPrefixOnResume, encodeBrightsyTarget, enrichPathWithNpmGlobalBin, enrichWorkspacesWithGithub, ensureAgentPath, ensureCloudCoordinator, ensureGhPreferOrigin, ensureGlobalCoordinatorCwd, ensureReviewRequestFile, ensureReviewSkillFile, ensureSlackCoordinator, ensureSlackDeviceIdentity, ensureWorkspace, estimateMessageChars, estimateThreadChars, expandComposerPrompt, extractGhErrorDetail, extractPendingPlanQuestions, extractPresentedPlan, extractiveSummary, fetchPrHead, finalizeParts, findConventionSetup, findInvalidCacheControlTtlOrder, findOrphanWorktrees, findSlackCoordinator, findThreadByRef, findThreadForStackLayer, fireSchedule, flattenTurnInput, forkChatTab, forkMessageSlice, forkThreadWorktree, formatAgentInstructions, formatArtifactDirective, formatBrightsyFetchError, formatFetchError, formatGhLandError, formatGitAuthModeDirective, formatIpcInvokeError, formatMergePrError, formatMessagesAsTranscript, formatPlanQuestionAnswers, formatPlanQuestionsForChat, formatProcessGuideDirective, formatRateLimitResetHint, formatRenameBranchDirective, formatScheduleWhen, formatScheduledPrompt, formatSlackExternalReplyPrompt, formatSlackInboundPrompt, formatSlackRepliesForTurn, formatSlackReplyContinuePrompt, formatSlackSignedReply, formatSlackWorkingText, 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, getSchedule, getSlackWorkspace, gh, ghHeadRef, ghRepoSelectArgs, git, githubAgentGitEnv, globalAgentCwd, handleSlackInbound, harnessEnvKey, hasBakedLinearOAuth, hasBakedSlackOAuth, hasConductorHook, hasConventionSetup, hasCursorWorktreeSetup, hasEnabledSchedules, hasRepoHook, hasWorkspaceHook, healOrchestrationSoccerTitles, httpFetch, importConductorWorkspace, importConductorWorkspaceAsync, initPrStack, initStackFromThread, initializeGitRepository, inspectGitWorktree, installAgent, interruptSlackCoordinatorForInbound, isAskUserToolName, isBrightsyConnected, isBrightsyNdjsonLine, isCloudCoordinatorThread, isConductorBundledCli, isCowboyThread, isCursorAutoModel, isDefaultishSourceRef, isDesktopHostAlive, isDirty, isGhRateLimitError, isGlobalRepoPath, isGlobalThread, isImageFilePath, isInPrStack, isInboundForThisDesktop, isLinearConnected, isLinearOAuthCancelled, isOrchestratorCapableAgent, isOrchestratorThread, isPidAlive, isPlaceholderBranch, isPollWrapperToolName, isPrNotMergeableError, isPresentPlanToolName, isPrimaryCheckoutThread, isSessionQuotaLimit, isShellToolName, isSideboardScratchPath, isSlackCoordinatorThread, isSlackExternalReplyPrompt, isSlackOAuthCancelled, isSubagentToolName, isThinkingEffort, isThisProcessDesktopHost, isThreadCaffeinated, isThreadRecordFile, isWorkspaceScratchPath, lastRequestOccupancy, linearAuthorizationHeader, linearGraphql, linearOAuthAuthorizeUrl, linearOAuthCredentials, listAgentSetupInfo, listBranchCommits, listBranches, listBrightsyAccounts, listBrightsyChatTargets, listCodexModels, listConductorWorkspaces, listConnectedBrightsyTeams, listCursorModels, listGitHubIssues, listGlobalThreads, listIssues, listLinearIssues, listLinearIssuesDirect, listLinearTeams, listModelsForAgent, listOpencodeModels, listPrs, listRunScripts, listSchedules, listSlackOutboundWatches, listSlackReplyBadges, listSlackWorkspaces, listThreads, listWorkspaces, listWorktreeFiles, listWorktrees, liveActivitySummary, loadAgentInstructions, loadAppSettings, loadBrightsyConfig, loadConductorSettings, loadRepoSettings, loadWorkspaceSettings, locksDir, loginAgent, lookupSoccerTeam, maxConcurrentAgents, maybeCompactContext, mcpAllowTools, mcpAuthWarnings, mergeAgentGitAuthEnv, mergePr, mergePrStack, mergeSideboardIntoMcpServersJson, mergeUsage, messagePartParentId, nextPastedTextName, nextThinkingEffort, nonInteractiveGitProcessEnv, normalizeParseResult, normalizeThinkingEffort, normalizeThread, normalizeTurnInput, normalizeWorktreePath, openInSystemTerminal, openPrStackLayers, openStackLayer, opencodeAdapter, orchestrationQuotaFallbackAgent, orchestrationQuotaOnLimit, orchestrationTitleNeedsSoccerNickname, orchestratorSessionPoisonedByBuiltins, originGhRepoEnv, parseCursorRunnerLine, parseDurationMs, parseForceStopMessage, parseGhStackViewJson, parseGithubSlugFromRemoteUrl, parseMcpList, parsePlanQuestionsInput, parseSessionQuotaResetAt, parseSlackRelayClientMessage, parseSlackRelayServerMessage, partsToAssistantText, pastedTextStats, pendingSlackExternalReplies, permalinkForSlackReplyBadge, permissionMode, persistVaultKeyInKeychain, planFileAbs, posixShellSingleQuote, preferredCursorCostCents, prepareTerminalCommand, previewLand, promptMentionsBrightsy, pushBranch, readExistingReviewRequestFile, readKeychainVaultKey, readPlanFile, readSkillBody, readThread, readWorktreeFile, readWorktreeFileForUpload, readWorktreeInclude, recordScheduleRun, recordSlackOutboundWatch, refreshGitHubAuth, refreshSlackReplyBadges, registerPackagedUserMcpClients, releaseCaffeinateHoldForThread, releaseDesktopHost, removeWorkspace, removeWorktree, repoSlug, requestOccupancy, requestReview, requireAgent, resetGhStackDetectCache, resetGithubAgentTokenMemo, resolveAgentExecutable, resolveAgentGitAuthEnv, resolveClaudeExecutable, resolveCodexGitWritableRoots, resolveCommandBinarySync, resolveConductorCursorAgentId, resolveCursorModelId, resolveDefaultBranch, resolveDiffBaseRef, resolveEffectiveIssueSource, resolveFilesToCopy, resolveGhAuthToken, resolveGitDirsForLockRecovery, resolveGithubAgentToken, resolveGithubRepoSlug, resolveLinearState, resolveLinearTeam, resolveLoginCommand, resolveNewThreadOptions, resolvePlanMarkdown, resolvePrSelector, resolvePrSelectors, resolveQuotaFallbackAgent, resolveRepoRoot, resolveReviewGuidelines, resolveScheduleThreadId, resolveSlackListenMode, resolveThreadDefaults, resolveThreadEffort, resolveVaultKey, resolveWorktreeStartPoint, rewriteLinearError, run, runArchiveScript, runCloudConnect, runConventionSetup, runCursorWorktreeSetup, runSetupScript, runSlackListen, runSlackRelayClient, runWorkspaceSetup, sameWorktreePath, sanitizeMcpServerName, saveAppSettings, saveLinearOAuth, schedulesPath, scrubGithubTokensFromChildEnv, secureFileUnlocksWith, setCaffeinateHold, setHttpFetchImpl, setStatus, setVaultMasterKey, settingsSourceLabel, shouldAttachPastedText, shouldCompactContext, shouldInjectBrightsyMcp, shouldRefreshReviewRequestTemplate, shouldRemoveWorktreeOnTeardown, shouldResetSessionForOccupancy, shouldRunWorktreeCleanup, showCostEnabled, 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, sumUsageList, summarizeConversation, switchBrightsyAccount, syncWorkspacesFromThreads, takenTeamSlugsForChatTab, takenTeamSlugsForOrchestration, taskMessageText, thinkingEffortBars, thinkingEffortLabel, thisProcessShouldDrainAgentQueues, threadDisplayLabel, threadFilePath, threadLivePath, threadLockPath, threadRequestsBrightsyMcp, threadsDir, threadsSharingWorktree, toPublicAppSettings, toolActivityLine, toolDescription, toolDetail, toolFilePath, totalTokens, turnCostUsdFromCursorUsage, updateAdvancedSettings, updateAgentExecutable, updateAppEnvironment, updateBrightsySettings, updateClaudeSettings, updateCodexSettings, updateDefaultsSettings, updateIntegrationsSettings, updateLinearIssue, updateOpencodeSettings, updateSchedule, updateThread, userClaudeMcpConfigPath, userCursorMcpConfigPath, validateLinearApiKey, waitForPidExit, warmGithubAgentAuth, withAgentInstructions, withEventParentId, withEventsParentId, withExportedPath, withMaxOldSpaceSize, withThreadLock, workspaceSettingsSourceLabel, worktreeCleanupSettings, worktreeDisplayLabel, worktreeDisplayLabelForGroup, worktreeNameFromPath, worktreesRoot, wrapReviewSkillMarkdown, writeInjectedMcpConfig, writePlanFile, writeThread, writeWorktreeFile };
4721
+ interface SlackOutboundReply {
4722
+ userId: string;
4723
+ userName: string;
4724
+ ts: string;
4725
+ text: string;
4726
+ }
4727
+ interface SlackOutboundWatch {
4728
+ id: string;
4729
+ teamId: string;
4730
+ channelId: string;
4731
+ /** Posted message ts. */
4732
+ ts: string;
4733
+ /** Parent thread ts (same as `ts` for top-level posts). */
4734
+ threadTs: string;
4735
+ kind: 'dm' | 'channel';
4736
+ toUserId?: string;
4737
+ toLabel: string;
4738
+ ownerUserId?: string;
4739
+ /** Sideboard orchestration thread that called slack_post. */
4740
+ sourceThreadId?: string;
4741
+ postedAt: string;
4742
+ lastSeenTs: string;
4743
+ permalink?: string;
4744
+ /** Reply timestamps already copied into the source thread (not commands). */
4745
+ injectedReplyTs?: string[];
4746
+ replies?: SlackOutboundReply[];
4747
+ }
4748
+ declare function slackArchiveUrl(channelId: string, ts: string): string;
4749
+ declare function formatSlackExternalReplyPrompt(input: {
4750
+ userName: string;
4751
+ kind: 'dm' | 'channel';
4752
+ toLabel: string;
4753
+ text: string;
4754
+ permalink?: string;
4755
+ }): string;
4756
+ declare function isSlackExternalReplyPrompt(text: string): boolean;
4757
+ /**
4758
+ * Slack replies appended after the last agent turn and before the current user
4759
+ * prompt. CLI --resume does not see Sideboard-injected messages, so the next
4760
+ * turn must include these in `prompt` (not cachedPrefix).
4761
+ */
4762
+ declare function pendingSlackExternalReplies(messages: Array<{
4763
+ role: string;
4764
+ text: string;
4765
+ }>): string[];
4766
+ declare function formatSlackRepliesForTurn(replies: string[]): string | null;
4767
+ declare function formatSlackReplyContinuePrompt(input: {
4768
+ userName: string;
4769
+ kind: 'dm' | 'channel';
4770
+ toLabel: string;
4771
+ count: number;
4772
+ }): string;
4773
+ declare function listSlackOutboundWatches(): SlackOutboundWatch[];
4774
+ declare function recordSlackOutboundWatch(input: {
4775
+ teamId: string;
4776
+ channelId: string;
4777
+ ts: string;
4778
+ threadTs?: string;
4779
+ kind: 'dm' | 'channel';
4780
+ toUserId?: string;
4781
+ toLabel: string;
4782
+ ownerUserId?: string;
4783
+ sourceThreadId?: string;
4784
+ }): SlackOutboundWatch | null;
4785
+ declare function pollSlackOutboundWatches(opts?: {
4786
+ fetchImpl?: typeof fetch;
4787
+ force?: boolean;
4788
+ now?: number;
4789
+ }): Promise<void>;
4790
+
4791
+ export { AGENT_GIT_ACTIONS, AGENT_RUNNER_MAX_OLD_SPACE_MB, 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 CowboyThreadFields, type CreateChatTabInput, type CreateGlobalChatOpts, type CreateScheduledTaskInput, type CreateStackInput, type CreateThreadInput, type CreateWorktreeResult, type CursorAgentUsageSnapshot, type CursorModelInfo, type CursorSdkStreamMessage, type CursorTurnRequest, type CursorUsageCost, 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, REVIEW_SKILL_NAME, REVIEW_SKILL_PATH, type RepoSettings, type RepoSetupInfo, type RequestReviewResult, type ResolvedReviewGuidelines, type ReviewGuidelinesSource, type RunMode, type RunScript, SESSION_RESET_OCCUPANCY_TOKENS, 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_PROGRESS_DELAY_MS, SLACK_PROGRESS_EDIT_MS, SLACK_REPLY_FORMATTING, SLACK_SEEN_REACTION, type ScheduleCreatedBy, type ScheduleWhen, type ScheduledTask, 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 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 UpdateScheduledTaskPatch, type UsageScope, WORKTREE_MCP_TOOLS, type Workspace, type WorkspaceInventoryEntry, type WorkspaceScriptEnvOpts, ackSlackInboundSeen, addPrStackLayer, addStackLayerFromThread, addWorkspace, adoptThread, agentGitPrompt, allAdapters, allocatePort, allocatePortRange, allocateTeamName, allocateTeamSlug, appDataDir, appSettingsPath, appendIndexedGitConfig, appendMessage, applyAgentEvent, applyAgentRunnerHeapEnv, applyAppEnvironment, applyCompaction, applyGithubGitAuthEnv, applyPromptCacheTtlEnv, applyThreadIntoMain, applyTurnUsage, armSchedules, 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, caffeinateWhileSchedulesEnabled, caffeinateWhileSlackListenEnabled, captureLoginEnv, captureTurnBaseline, checkoutPrStackLayer, childEnvWithAppSettings, claimDesktopHost, claudeAdapter, claudeChromeEnabled, claudeUserSettingsPath, cleanupOrphanWorktrees, cloneRepoIntoSideboard, codexAdapter, codexSandboxWritableRootsArgs, codexUnattendedGitConfigArgs, coerceOrchestratorAgent, collectTakenTeamSlugs, commentLinearIssue, commitAll, computeNextRunAt, conductorBundledBinDir, conductorDbPath, confirmLand, connectBrightsyTeam, connectSlackToken, contextTokens, coordinatorSystemPrompt, coordinatorTurnReminder, copyConfiguredFiles, countCacheControlBlocks, cowboyModeEnabled, createChatTab, createEmptyThread, createExistingBranchWorktree, createGlobalChat, createLinearIssue, createLinearPkce, createOrUpdatePr, createPrStack, createSchedule, createThread, createThreadWorktree, currentBranch, cursorAdapter, cursorSdkMessageToEvents, decodeBrightsyTarget, defaultScheduleName, deleteBranchOnPurgeEnabled, deleteSchedule, deleteThreadRecord, desktopHostPidPath, detectAgents, detectGhStack, detectLocalMergeConflicts, disconnectBrightsyTeam, disconnectLinear, disconnectLinearConnection, disconnectSlackWorkspace, discoverSkills, dropCachedPrefixOnResume, encodeBrightsyTarget, enrichPathWithNpmGlobalBin, enrichWorkspacesWithGithub, ensureAgentPath, ensureCloudCoordinator, ensureGhPreferOrigin, ensureGlobalCoordinatorCwd, ensureReviewRequestFile, ensureReviewSkillFile, ensureSlackCoordinator, ensureSlackDeviceIdentity, ensureWorkspace, estimateMessageChars, estimateThreadChars, expandComposerPrompt, extractGhErrorDetail, extractPendingPlanQuestions, extractPresentedPlan, extractiveSummary, fetchPrHead, finalizeParts, findConventionSetup, findInvalidCacheControlTtlOrder, findOrphanWorktrees, findSlackCoordinator, findThreadByRef, findThreadForStackLayer, fireSchedule, flattenTurnInput, forkChatTab, forkMessageSlice, forkThreadWorktree, formatAgentInstructions, formatArtifactDirective, formatBrightsyFetchError, formatFetchError, formatGhLandError, formatGitAuthModeDirective, formatIpcInvokeError, formatMergePrError, formatMessagesAsTranscript, formatPlanQuestionAnswers, formatPlanQuestionsForChat, formatProcessGuideDirective, formatRateLimitResetHint, formatRenameBranchDirective, formatScheduleWhen, formatScheduledPrompt, formatSlackExternalReplyPrompt, formatSlackInboundPrompt, formatSlackRepliesForTurn, formatSlackReplyContinuePrompt, formatSlackSignedReply, formatSlackWorkingText, 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, getSchedule, getSlackWorkspace, gh, ghHeadRef, ghRepoSelectArgs, git, githubAgentGitEnv, globalAgentCwd, handleSlackInbound, harnessEnvKey, hasBakedLinearOAuth, hasBakedSlackOAuth, hasConductorHook, hasConventionSetup, hasCursorWorktreeSetup, hasEnabledSchedules, hasRepoHook, hasWorkspaceHook, healOrchestrationSoccerTitles, httpFetch, importConductorWorkspace, importConductorWorkspaceAsync, initPrStack, initStackFromThread, initializeGitRepository, inspectGitWorktree, installAgent, interruptSlackCoordinatorForInbound, isAskUserToolName, isBrightsyConnected, isBrightsyNdjsonLine, isCloudCoordinatorThread, isConductorBundledCli, isCowboyThread, isCursorAutoModel, isDefaultishSourceRef, isDesktopHostAlive, isDirty, isGhRateLimitError, isGlobalRepoPath, isGlobalThread, isImageFilePath, isInPrStack, isInboundForThisDesktop, isLinearConnected, isLinearOAuthCancelled, isOrchestratorCapableAgent, isOrchestratorThread, isPidAlive, isPlaceholderBranch, isPollWrapperToolName, isPrNotMergeableError, isPresentPlanToolName, isPrimaryCheckoutThread, isSessionQuotaLimit, isShellToolName, isSideboardScratchPath, isSlackCoordinatorThread, isSlackExternalReplyPrompt, isSlackOAuthCancelled, isSubagentToolName, isThinkingEffort, isThisProcessDesktopHost, isThreadCaffeinated, isThreadRecordFile, isWorkspaceScratchPath, lastRequestOccupancy, linearAuthorizationHeader, linearGraphql, linearOAuthAuthorizeUrl, linearOAuthCredentials, listAgentSetupInfo, listBranchCommits, listBranches, listBrightsyAccounts, listBrightsyChatTargets, listCodexModels, listConductorWorkspaces, listConnectedBrightsyTeams, listCursorModels, listGitHubIssues, listGlobalThreads, listIssues, listLinearIssues, listLinearIssuesDirect, listLinearTeams, listModelsForAgent, listOpencodeModels, listPrs, listRunScripts, listSchedules, listSlackOutboundWatches, listSlackWorkspaces, listThreads, listWorkspaces, listWorktreeFiles, listWorktrees, liveActivitySummary, loadAgentInstructions, loadAppSettings, loadBrightsyConfig, loadConductorSettings, loadRepoSettings, loadWorkspaceSettings, locksDir, loginAgent, lookupSoccerTeam, maxConcurrentAgents, maybeCompactContext, mcpAllowTools, mcpAuthWarnings, mergeAgentGitAuthEnv, mergePr, mergePrStack, mergeSideboardIntoMcpServersJson, mergeUsage, messagePartParentId, nextPastedTextName, nextThinkingEffort, nonInteractiveGitProcessEnv, normalizeParseResult, normalizeThinkingEffort, normalizeThread, normalizeTurnInput, normalizeWorktreePath, openInSystemTerminal, openPrStackLayers, openStackLayer, opencodeAdapter, orchestrationQuotaFallbackAgent, orchestrationQuotaOnLimit, orchestrationTitleNeedsSoccerNickname, orchestratorSessionPoisonedByBuiltins, originGhRepoEnv, parseCursorRunnerLine, parseDurationMs, parseForceStopMessage, parseGhStackViewJson, parseGithubSlugFromRemoteUrl, parseMcpList, parsePlanQuestionsInput, parseSessionQuotaResetAt, parseSlackRelayClientMessage, parseSlackRelayServerMessage, partsToAssistantText, pastedTextStats, pendingSlackExternalReplies, permissionMode, persistVaultKeyInKeychain, planFileAbs, pollSlackOutboundWatches, posixShellSingleQuote, preferredCursorCostCents, prepareTerminalCommand, previewLand, promptMentionsBrightsy, pushBranch, readExistingReviewRequestFile, readKeychainVaultKey, readPlanFile, readSkillBody, readThread, readWorktreeFile, readWorktreeFileForUpload, readWorktreeInclude, recordScheduleRun, recordSlackOutboundWatch, refreshGitHubAuth, registerPackagedUserMcpClients, releaseCaffeinateHoldForThread, releaseDesktopHost, removeWorkspace, removeWorktree, repoSlug, requestOccupancy, requestReview, requireAgent, resetGhStackDetectCache, resetGithubAgentTokenMemo, resolveAgentExecutable, resolveAgentGitAuthEnv, resolveClaudeExecutable, resolveCodexGitWritableRoots, resolveCommandBinarySync, resolveConductorCursorAgentId, resolveCursorModelId, resolveDefaultBranch, resolveDiffBaseRef, resolveEffectiveIssueSource, resolveFilesToCopy, resolveGhAuthToken, resolveGitDirsForLockRecovery, resolveGithubAgentToken, resolveGithubRepoSlug, resolveLinearState, resolveLinearTeam, resolveLoginCommand, resolveNewThreadOptions, resolvePlanMarkdown, resolvePrSelector, resolvePrSelectors, resolveQuotaFallbackAgent, resolveRepoRoot, resolveReviewGuidelines, resolveScheduleThreadId, resolveSlackListenMode, resolveThreadDefaults, resolveThreadEffort, resolveVaultKey, resolveWorktreeStartPoint, rewriteLinearError, run, runArchiveScript, runCloudConnect, runConventionSetup, runCursorWorktreeSetup, runSetupScript, runSlackListen, runSlackRelayClient, runWorkspaceSetup, sameWorktreePath, sanitizeMcpServerName, saveAppSettings, saveLinearOAuth, schedulesPath, scrubGithubTokensFromChildEnv, secureFileUnlocksWith, setCaffeinateHold, setHttpFetchImpl, setStatus, setVaultMasterKey, settingsSourceLabel, shouldAttachPastedText, shouldCompactContext, shouldInjectBrightsyMcp, shouldRefreshReviewRequestTemplate, shouldRemoveWorktreeOnTeardown, shouldResetSessionForOccupancy, shouldRunWorktreeCleanup, showCostEnabled, 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, sumUsageList, summarizeConversation, switchBrightsyAccount, syncWorkspacesFromThreads, takenTeamSlugsForChatTab, takenTeamSlugsForOrchestration, taskMessageText, thinkingEffortBars, thinkingEffortLabel, thisProcessShouldDrainAgentQueues, threadDisplayLabel, threadFilePath, threadLivePath, threadLockPath, threadRequestsBrightsyMcp, threadsDir, threadsSharingWorktree, toPublicAppSettings, toolActivityLine, toolDescription, toolDetail, toolFilePath, totalTokens, turnCostUsdFromCursorUsage, updateAdvancedSettings, updateAgentExecutable, updateAppEnvironment, updateBrightsySettings, updateClaudeSettings, updateCodexSettings, updateDefaultsSettings, updateIntegrationsSettings, updateLinearIssue, updateOpencodeSettings, updateSchedule, updateThread, userClaudeMcpConfigPath, userCursorMcpConfigPath, validateLinearApiKey, waitForPidExit, warmGithubAgentAuth, withAgentInstructions, withEventParentId, withEventsParentId, withExportedPath, withMaxOldSpaceSize, withThreadLock, workspaceSettingsSourceLabel, worktreeCleanupSettings, worktreeDisplayLabel, worktreeDisplayLabelForGroup, worktreeNameFromPath, worktreesRoot, wrapReviewSkillMarkdown, writeInjectedMcpConfig, writePlanFile, writeThread, writeWorktreeFile };
package/dist/index.js CHANGED
@@ -52,7 +52,6 @@ import {
52
52
  detectAgents,
53
53
  disconnectSlackWorkspace,
54
54
  discoverSkills,
55
- dismissSlackReplyBadge,
56
55
  ensureReviewRequestFile,
57
56
  ensureReviewSkillFile,
58
57
  estimateMessageChars,
@@ -108,7 +107,6 @@ import {
108
107
  listRunScripts,
109
108
  listSchedules,
110
109
  listSlackOutboundWatches,
111
- listSlackReplyBadges,
112
110
  listSlackWorkspaces,
113
111
  listSlackWorkspacesRaw,
114
112
  listWorktreeFiles,
@@ -118,7 +116,7 @@ import {
118
116
  openStackLayer,
119
117
  parseDurationMs,
120
118
  pendingSlackExternalReplies,
121
- permalinkForSlackReplyBadge,
119
+ pollSlackOutboundWatches,
122
120
  previewLand,
123
121
  readExistingReviewRequestFile,
124
122
  readSkillBody,
@@ -128,7 +126,6 @@ import {
128
126
  readWorktreeInclude,
129
127
  recordScheduleRun,
130
128
  recordSlackOutboundWatch,
131
- refreshSlackReplyBadges,
132
129
  releaseDesktopHost,
133
130
  requestReview,
134
131
  requireAgent,
@@ -171,7 +168,7 @@ import {
171
168
  worktreeCleanupSettings,
172
169
  wrapReviewSkillMarkdown,
173
170
  writeWorktreeFile
174
- } from "./chunk-MZDAEI3Y.js";
171
+ } from "./chunk-ED27HCPV.js";
175
172
  import {
176
173
  BRIGHTSY_MCP_ALLOWED_TOOLS,
177
174
  CLAUDE_MODEL_CATALOG,
@@ -1941,7 +1938,7 @@ function registerSlackTools(server) {
1941
1938
  },
1942
1939
  async ({ team_id }) => {
1943
1940
  try {
1944
- await refreshSlackReplyBadges({ force: true });
1941
+ await pollSlackOutboundWatches({ force: true });
1945
1942
  const team = team_id?.trim();
1946
1943
  const watches = listSlackOutboundWatches().filter(
1947
1944
  (w) => !team || w.teamId === team
@@ -5771,7 +5768,6 @@ export {
5771
5768
  disconnectLinearConnection,
5772
5769
  disconnectSlackWorkspace,
5773
5770
  discoverSkills,
5774
- dismissSlackReplyBadge,
5775
5771
  dropCachedPrefixOnResume,
5776
5772
  encodeBrightsyTarget,
5777
5773
  enrichPathWithNpmGlobalBin,
@@ -5953,7 +5949,6 @@ export {
5953
5949
  listRunScripts,
5954
5950
  listSchedules,
5955
5951
  listSlackOutboundWatches,
5956
- listSlackReplyBadges,
5957
5952
  listSlackWorkspaces,
5958
5953
  listThreads,
5959
5954
  listWorkspaces,
@@ -6009,10 +6004,10 @@ export {
6009
6004
  partsToAssistantText,
6010
6005
  pastedTextStats,
6011
6006
  pendingSlackExternalReplies,
6012
- permalinkForSlackReplyBadge,
6013
6007
  permissionMode,
6014
6008
  persistVaultKeyInKeychain,
6015
6009
  planFileAbs,
6010
+ pollSlackOutboundWatches,
6016
6011
  posixShellSingleQuote,
6017
6012
  preferredCursorCostCents,
6018
6013
  prepareTerminalCommand,
@@ -6030,7 +6025,6 @@ export {
6030
6025
  recordScheduleRun,
6031
6026
  recordSlackOutboundWatch,
6032
6027
  refreshGitHubAuth,
6033
- refreshSlackReplyBadges,
6034
6028
  registerPackagedUserMcpClients,
6035
6029
  releaseCaffeinateHoldForThread,
6036
6030
  releaseDesktopHost,
@@ -998,26 +998,9 @@ function storePath3() {
998
998
  function watchId(teamId, channelId, ts) {
999
999
  return `${teamId}:${channelId}:${ts}`;
1000
1000
  }
1001
- function badgeId(teamId, userId) {
1002
- return `${teamId}:${userId}`;
1003
- }
1004
1001
  function slackArchiveUrl(channelId, ts) {
1005
1002
  return `https://slack.com/archives/${channelId}/p${ts.replace(".", "")}`;
1006
1003
  }
1007
- function initialsFromName(name) {
1008
- const parts = name.trim().split(/\s+/).filter(Boolean);
1009
- if (parts.length === 0) return "?";
1010
- if (parts.length === 1) {
1011
- const w = parts[0];
1012
- return (w.slice(0, 2) || "?").toUpperCase();
1013
- }
1014
- return `${parts[0][0] ?? ""}${parts[parts.length - 1][0] ?? ""}`.toUpperCase();
1015
- }
1016
- function hueFromId(id) {
1017
- let h = 0;
1018
- for (const c of id) h = h * 31 + c.charCodeAt(0) >>> 0;
1019
- return h % 360;
1020
- }
1021
1004
  function tsNewer(a, b) {
1022
1005
  return Number(a) > Number(b);
1023
1006
  }
@@ -1173,7 +1156,6 @@ function recordSlackOutboundWatch(input) {
1173
1156
  sourceThreadId: input.sourceThreadId?.trim() || void 0,
1174
1157
  postedAt: (/* @__PURE__ */ new Date()).toISOString(),
1175
1158
  lastSeenTs: ts,
1176
- unread: false,
1177
1159
  permalink: slackArchiveUrl(channelId, ts),
1178
1160
  injectedReplyTs: [],
1179
1161
  replies: []
@@ -1260,36 +1242,9 @@ async function fetchMessages(token, watch, fetchImpl) {
1260
1242
  }
1261
1243
  return out;
1262
1244
  }
1263
- function listSlackReplyBadges() {
1264
- const unread = readStore3().filter((w) => w.unread && w.replyUserId && w.permalink);
1265
- const byUser = /* @__PURE__ */ new Map();
1266
- for (const w of unread) {
1267
- const id = badgeId(w.teamId, w.replyUserId);
1268
- const prev = byUser.get(id);
1269
- if (!prev || tsNewer(w.replyTs || "", prev.replyTs || "")) {
1270
- byUser.set(id, w);
1271
- }
1272
- }
1273
- return [...byUser.entries()].map(([id, w]) => {
1274
- const userName = w.replyUserName || w.toLabel || "Slack";
1275
- return {
1276
- id,
1277
- userId: w.replyUserId,
1278
- userName,
1279
- initials: initialsFromName(userName),
1280
- hue: hueFromId(w.replyUserId),
1281
- permalink: w.permalink || slackArchiveUrl(w.channelId, w.replyTs || w.ts),
1282
- label: w.toLabel,
1283
- preview: w.replyPreview,
1284
- repliedAt: w.replyTs || w.postedAt
1285
- };
1286
- }).sort((a, b) => b.repliedAt.localeCompare(a.repliedAt));
1287
- }
1288
- async function refreshSlackReplyBadges(opts) {
1245
+ async function pollSlackOutboundWatches(opts) {
1289
1246
  const now = opts?.now ?? Date.now();
1290
- if (!opts?.force && now - lastPollMs < POLL_INTERVAL_MS) {
1291
- return listSlackReplyBadges();
1292
- }
1247
+ if (!opts?.force && now - lastPollMs < POLL_INTERVAL_MS) return;
1293
1248
  lastPollMs = now;
1294
1249
  const existing = readStore3();
1295
1250
  let watches = pruneWatches(existing, now);
@@ -1310,9 +1265,7 @@ async function refreshSlackReplyBadges(opts) {
1310
1265
  const injected2 = new Set(watch.injectedReplyTs ?? []);
1311
1266
  const collected = [...watch.replies ?? []];
1312
1267
  let lastSeenTs = watch.lastSeenTs;
1313
- let latestUser;
1314
1268
  let latestName;
1315
- let latestText = "";
1316
1269
  let latestPermalink = watch.permalink;
1317
1270
  let newlyInjected = 0;
1318
1271
  for (const msg of replies) {
@@ -1338,9 +1291,7 @@ async function refreshSlackReplyBadges(opts) {
1338
1291
  text: msg.text ?? ""
1339
1292
  };
1340
1293
  if (!collected.some((r) => r.ts === ts)) collected.push(reply);
1341
- latestUser = user;
1342
1294
  latestName = replyUserName;
1343
- latestText = reply.text;
1344
1295
  latestPermalink = permalink;
1345
1296
  if (injected2.has(ts)) {
1346
1297
  lastSeenTs = ts;
@@ -1371,11 +1322,6 @@ async function refreshSlackReplyBadges(opts) {
1371
1322
  watches[i] = {
1372
1323
  ...watch,
1373
1324
  lastSeenTs,
1374
- unread: true,
1375
- replyUserId: latestUser,
1376
- replyUserName: latestName,
1377
- replyTs: lastSeenTs,
1378
- replyPreview: latestText.slice(0, 140),
1379
1325
  permalink: latestPermalink,
1380
1326
  injectedReplyTs: [...injected2],
1381
1327
  replies: collected.slice(-MAX_REPLIES_PER_WATCH)
@@ -1383,7 +1329,6 @@ async function refreshSlackReplyBadges(opts) {
1383
1329
  changed = true;
1384
1330
  }
1385
1331
  if (changed) writeStore(watches);
1386
- return listSlackReplyBadges();
1387
1332
  }
1388
1333
  var import_node_fs9, import_node_path10, MAX_WATCHES, MAX_REPLIES_PER_WATCH, WATCH_TTL_MS, POLL_INTERVAL_MS, lastPollMs, nameCache, continueOnReply;
1389
1334
  var init_outbound_watch = __esm({
@@ -18229,7 +18174,7 @@ function registerSlackTools(server) {
18229
18174
  },
18230
18175
  async ({ team_id }) => {
18231
18176
  try {
18232
- await refreshSlackReplyBadges({ force: true });
18177
+ await pollSlackOutboundWatches({ force: true });
18233
18178
  const team = team_id?.trim();
18234
18179
  const watches = listSlackOutboundWatches().filter(
18235
18180
  (w) => !team || w.teamId === team
@@ -11,15 +11,15 @@ import {
11
11
  listSchedules,
12
12
  listSlackOutboundWatches,
13
13
  listSlackWorkspaces,
14
+ pollSlackOutboundWatches,
14
15
  readTurnLive,
15
16
  recordSlackOutboundWatch,
16
- refreshSlackReplyBadges,
17
17
  requireSlackWorkspace,
18
18
  resolveScheduleThreadId,
19
19
  slackApi,
20
20
  slackTokenFor,
21
21
  updateSchedule
22
- } from "../chunk-SDCPQL27.js";
22
+ } from "../chunk-GKY2GR2J.js";
23
23
  import {
24
24
  listModelsForAgent,
25
25
  sideboardMcpProfile
@@ -1027,7 +1027,7 @@ function registerSlackTools(server) {
1027
1027
  },
1028
1028
  async ({ team_id }) => {
1029
1029
  try {
1030
- await refreshSlackReplyBadges({ force: true });
1030
+ await pollSlackOutboundWatches({ force: true });
1031
1031
  const team = team_id?.trim();
1032
1032
  const watches = listSlackOutboundWatches().filter(
1033
1033
  (w) => !team || w.teamId === team
@@ -6,7 +6,7 @@ import {
6
6
  isPidAlive,
7
7
  startOrchestration,
8
8
  waitForPidExit
9
- } from "./chunk-SDCPQL27.js";
9
+ } from "./chunk-GKY2GR2J.js";
10
10
  import "./chunk-JNAIKICO.js";
11
11
  import "./chunk-YMRT2DU6.js";
12
12
  import "./chunk-RBVVWBVB.js";
@@ -4,7 +4,7 @@ import {
4
4
  isPidAlive,
5
5
  startOrchestration,
6
6
  waitForPidExit
7
- } from "./chunk-MZDAEI3Y.js";
7
+ } from "./chunk-ED27HCPV.js";
8
8
  import "./chunk-7Y3AYQWT.js";
9
9
  import "./chunk-EKIDHL2T.js";
10
10
  import "./chunk-HZLE6LJJ.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sideboard-ai/core",
3
- "version": "0.1.124",
3
+ "version": "0.1.125",
4
4
  "description": "Sideboard core — orchestration, agents, git worktrees, MCP server",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",