@sideboard-ai/core 0.1.142 → 0.1.144

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.
@@ -453,7 +453,7 @@ async function continueSourceThread(threadId, prompt) {
453
453
  await continueOnReply(threadId, prompt);
454
454
  return;
455
455
  }
456
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-I2T44CRP.js");
456
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-DB5ZSE6M.js");
457
457
  await getOrchestrator2().send(threadId, prompt);
458
458
  } catch {
459
459
  }
@@ -1257,6 +1257,71 @@ function buildSessionSeed(messages, opts) {
1257
1257
  "Continue from this context. Do not repeat the summary unless asked."
1258
1258
  ].join("\n");
1259
1259
  }
1260
+ var BRIGHTSY_SUMMARIZE_CONTEXT_TOOL = "summarize_context";
1261
+ function extractBrightsyContextSummary(result) {
1262
+ if (!result?.trim()) return null;
1263
+ const trimmed = result.trim();
1264
+ const lower = trimmed.toLowerCase();
1265
+ if (lower.startsWith("context summarization failed") || lower.startsWith("nothing to summarize") || lower.startsWith("no messages found") || lower.startsWith("messages are required") || lower.startsWith("agent id is required")) {
1266
+ return null;
1267
+ }
1268
+ try {
1269
+ const parsed = JSON.parse(trimmed);
1270
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
1271
+ if (parsed.error != null && typeof parsed.context_summary !== "string") {
1272
+ return null;
1273
+ }
1274
+ if (typeof parsed.context_summary === "string" && parsed.context_summary.trim()) {
1275
+ return parsed.context_summary.trim();
1276
+ }
1277
+ return null;
1278
+ }
1279
+ } catch {
1280
+ }
1281
+ if (trimmed.includes('"error"') && !trimmed.includes("context_summary")) {
1282
+ return null;
1283
+ }
1284
+ return trimmed;
1285
+ }
1286
+ function findLastBrightsyContextSummary(messages) {
1287
+ for (let i = messages.length - 1; i >= 0; i--) {
1288
+ const message = messages[i];
1289
+ if (message?.role !== "agent") continue;
1290
+ for (const part of message.parts ?? []) {
1291
+ if (part.type !== "tool" || part.name !== BRIGHTSY_SUMMARIZE_CONTEXT_TOOL) {
1292
+ continue;
1293
+ }
1294
+ if (part.status === "error") continue;
1295
+ const text = extractBrightsyContextSummary(part.result);
1296
+ if (text) return { index: i, text };
1297
+ }
1298
+ }
1299
+ return null;
1300
+ }
1301
+ function messagesSinceLastBrightsyContextSummary(messages) {
1302
+ const match = findLastBrightsyContextSummary(messages);
1303
+ if (!match) return messages;
1304
+ return messages.slice(match.index + 1);
1305
+ }
1306
+ function buildBrightsySessionSeed(messages) {
1307
+ const match = findLastBrightsyContextSummary(messages);
1308
+ const tail = match ? messages.slice(match.index + 1) : messages;
1309
+ const body = formatMessagesAsTranscript(tail, { tools: "none" });
1310
+ if (!match && !body.trim()) return null;
1311
+ const blocks = [
1312
+ "Sideboard conversation context (restored after compaction or a new session):",
1313
+ ""
1314
+ ];
1315
+ if (match) {
1316
+ blocks.push(`## Prior summary
1317
+ ${match.text}`, "");
1318
+ }
1319
+ if (body.trim()) {
1320
+ blocks.push(body, "");
1321
+ }
1322
+ blocks.push("Continue from this context. Do not repeat the summary unless asked.");
1323
+ return blocks.join("\n");
1324
+ }
1260
1325
  function applyCompaction(messages, summaryText, thresholds = {}) {
1261
1326
  const { older, recent } = splitForCompaction(messages, thresholds);
1262
1327
  if (older.length === 0) return messages;
@@ -3154,6 +3219,16 @@ function shouldReadThreadToHealReconcile(eventType, lastCheckAt, now) {
3154
3219
  return true;
3155
3220
  }
3156
3221
 
3222
+ // src/orchestrator/setup-last-error.ts
3223
+ function shouldStampSetupLastError(opts) {
3224
+ if (opts.turnInFlight) return false;
3225
+ if (opts.status === "running") return false;
3226
+ return true;
3227
+ }
3228
+ function isStaleLastErrorDuringTurn(err) {
3229
+ return Boolean(err?.trim());
3230
+ }
3231
+
3157
3232
  // src/threads/fork-worktree.ts
3158
3233
  function requireThread2(idOrRef) {
3159
3234
  const thread = findThreadByRef(idOrRef) ?? null;
@@ -5848,7 +5923,7 @@ function formatScheduledPrompt(name, prompt) {
5848
5923
  ${prompt}`;
5849
5924
  }
5850
5925
  async function defaultDeps() {
5851
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-I2T44CRP.js");
5926
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-DB5ZSE6M.js");
5852
5927
  const orch = getOrchestrator2();
5853
5928
  return {
5854
5929
  findThread: (id) => findThreadByRef(id),
@@ -6329,6 +6404,13 @@ var Orchestrator = class {
6329
6404
  const message = err instanceof Error ? err.message : String(err);
6330
6405
  if (/no setup script/i.test(message)) return;
6331
6406
  if (/already running/i.test(message)) return;
6407
+ const live = readThread(threadId);
6408
+ if (!shouldStampSetupLastError({
6409
+ turnInFlight: this.activeTurns.has(threadId) || this.startingTurns.has(threadId),
6410
+ status: live?.status
6411
+ })) {
6412
+ return;
6413
+ }
6332
6414
  updateThread(threadId, {
6333
6415
  lastError: `Setup failed: ${message}`
6334
6416
  });
@@ -6625,7 +6707,7 @@ var Orchestrator = class {
6625
6707
  let seed = null;
6626
6708
  if (!fresh.sessionId) {
6627
6709
  const prior = fresh.messages.slice(0, -1);
6628
- seed = isBrightsy ? buildSessionSeed(prior.slice(-6), { tools: "none" }) : buildSessionSeed(prior);
6710
+ seed = isBrightsy ? buildBrightsySessionSeed(prior) : buildSessionSeed(prior);
6629
6711
  }
6630
6712
  let coordinatorDirective = null;
6631
6713
  if (isOrchestration) {
@@ -6675,7 +6757,7 @@ var Orchestrator = class {
6675
6757
  )) {
6676
6758
  this.lastReconcileHealAt.set(threadId, now);
6677
6759
  const live = readThread(threadId);
6678
- if (live?.lastError?.includes("reconciled on startup") && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
6760
+ if (isStaleLastErrorDuringTurn(live?.lastError) && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
6679
6761
  setStatus(threadId, "running");
6680
6762
  this.emit({ type: "status_changed", threadId, status: "running" });
6681
6763
  }
@@ -6752,7 +6834,7 @@ var Orchestrator = class {
6752
6834
  });
6753
6835
  const retryThread = this.requireThread(threadId);
6754
6836
  const prior = retryThread.messages.slice(0, -1);
6755
- const retrySeed = buildSessionSeed(prior);
6837
+ const retrySeed = isBrightsy ? buildBrightsySessionSeed(prior) : buildSessionSeed(prior);
6756
6838
  const retryPrefix = [
6757
6839
  coordinatorDirective,
6758
6840
  worktreeDirective,
@@ -7132,9 +7214,15 @@ var Orchestrator = class {
7132
7214
  );
7133
7215
  }
7134
7216
  if (setup.exitCode !== 0 && setup.exitCode !== null) {
7135
- updateThread(thread.id, {
7136
- lastError: `Setup exited ${setup.exitCode}`
7137
- });
7217
+ const live = readThread(thread.id);
7218
+ if (shouldStampSetupLastError({
7219
+ turnInFlight: this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id),
7220
+ status: live?.status
7221
+ })) {
7222
+ updateThread(thread.id, {
7223
+ lastError: `Setup exited ${setup.exitCode}`
7224
+ });
7225
+ }
7138
7226
  }
7139
7227
  this.emit({ type: "setup_finished", threadId: thread.id, exitCode: setup.exitCode });
7140
7228
  return { exitCode: setup.exitCode, source: setup.source };
@@ -7992,6 +8080,11 @@ export {
7992
8080
  splitForCompaction,
7993
8081
  formatMessagesAsTranscript,
7994
8082
  buildSessionSeed,
8083
+ BRIGHTSY_SUMMARIZE_CONTEXT_TOOL,
8084
+ extractBrightsyContextSummary,
8085
+ findLastBrightsyContextSummary,
8086
+ messagesSinceLastBrightsyContextSummary,
8087
+ buildBrightsySessionSeed,
7995
8088
  applyCompaction,
7996
8089
  lastRequestOccupancy,
7997
8090
  shouldResetSessionForOccupancy,
@@ -388,7 +388,7 @@ async function continueSourceThread(threadId, prompt) {
388
388
  await continueOnReply(threadId, prompt);
389
389
  return;
390
390
  }
391
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-4BEZJ2BU.js");
391
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-IQGVBBSH.js");
392
392
  await getOrchestrator2().send(threadId, prompt);
393
393
  } catch {
394
394
  }
@@ -1233,6 +1233,66 @@ function buildSessionSeed(messages, opts) {
1233
1233
  "Continue from this context. Do not repeat the summary unless asked."
1234
1234
  ].join("\n");
1235
1235
  }
1236
+ var BRIGHTSY_SUMMARIZE_CONTEXT_TOOL = "summarize_context";
1237
+ function extractBrightsyContextSummary(result) {
1238
+ if (!result?.trim()) return null;
1239
+ const trimmed = result.trim();
1240
+ const lower = trimmed.toLowerCase();
1241
+ if (lower.startsWith("context summarization failed") || lower.startsWith("nothing to summarize") || lower.startsWith("no messages found") || lower.startsWith("messages are required") || lower.startsWith("agent id is required")) {
1242
+ return null;
1243
+ }
1244
+ try {
1245
+ const parsed = JSON.parse(trimmed);
1246
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
1247
+ if (parsed.error != null && typeof parsed.context_summary !== "string") {
1248
+ return null;
1249
+ }
1250
+ if (typeof parsed.context_summary === "string" && parsed.context_summary.trim()) {
1251
+ return parsed.context_summary.trim();
1252
+ }
1253
+ return null;
1254
+ }
1255
+ } catch {
1256
+ }
1257
+ if (trimmed.includes('"error"') && !trimmed.includes("context_summary")) {
1258
+ return null;
1259
+ }
1260
+ return trimmed;
1261
+ }
1262
+ function findLastBrightsyContextSummary(messages) {
1263
+ for (let i = messages.length - 1; i >= 0; i--) {
1264
+ const message = messages[i];
1265
+ if (message?.role !== "agent") continue;
1266
+ for (const part of message.parts ?? []) {
1267
+ if (part.type !== "tool" || part.name !== BRIGHTSY_SUMMARIZE_CONTEXT_TOOL) {
1268
+ continue;
1269
+ }
1270
+ if (part.status === "error") continue;
1271
+ const text = extractBrightsyContextSummary(part.result);
1272
+ if (text) return { index: i, text };
1273
+ }
1274
+ }
1275
+ return null;
1276
+ }
1277
+ function buildBrightsySessionSeed(messages) {
1278
+ const match = findLastBrightsyContextSummary(messages);
1279
+ const tail = match ? messages.slice(match.index + 1) : messages;
1280
+ const body = formatMessagesAsTranscript(tail, { tools: "none" });
1281
+ if (!match && !body.trim()) return null;
1282
+ const blocks = [
1283
+ "Sideboard conversation context (restored after compaction or a new session):",
1284
+ ""
1285
+ ];
1286
+ if (match) {
1287
+ blocks.push(`## Prior summary
1288
+ ${match.text}`, "");
1289
+ }
1290
+ if (body.trim()) {
1291
+ blocks.push(body, "");
1292
+ }
1293
+ blocks.push("Continue from this context. Do not repeat the summary unless asked.");
1294
+ return blocks.join("\n");
1295
+ }
1236
1296
  function applyCompaction(messages, summaryText, thresholds = {}) {
1237
1297
  const { older, recent } = splitForCompaction(messages, thresholds);
1238
1298
  if (older.length === 0) return messages;
@@ -3091,6 +3151,16 @@ function shouldReadThreadToHealReconcile(eventType, lastCheckAt, now) {
3091
3151
  return true;
3092
3152
  }
3093
3153
 
3154
+ // src/orchestrator/setup-last-error.ts
3155
+ function shouldStampSetupLastError(opts) {
3156
+ if (opts.turnInFlight) return false;
3157
+ if (opts.status === "running") return false;
3158
+ return true;
3159
+ }
3160
+ function isStaleLastErrorDuringTurn(err) {
3161
+ return Boolean(err?.trim());
3162
+ }
3163
+
3094
3164
  // src/threads/fork-worktree.ts
3095
3165
  function requireThread2(idOrRef) {
3096
3166
  const thread = findThreadByRef(idOrRef) ?? null;
@@ -5536,7 +5606,7 @@ function formatScheduledPrompt(name, prompt) {
5536
5606
  ${prompt}`;
5537
5607
  }
5538
5608
  async function defaultDeps() {
5539
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-4BEZJ2BU.js");
5609
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-IQGVBBSH.js");
5540
5610
  const orch = getOrchestrator2();
5541
5611
  return {
5542
5612
  findThread: (id) => findThreadByRef(id),
@@ -6017,6 +6087,13 @@ var Orchestrator = class {
6017
6087
  const message = err instanceof Error ? err.message : String(err);
6018
6088
  if (/no setup script/i.test(message)) return;
6019
6089
  if (/already running/i.test(message)) return;
6090
+ const live = readThread(threadId);
6091
+ if (!shouldStampSetupLastError({
6092
+ turnInFlight: this.activeTurns.has(threadId) || this.startingTurns.has(threadId),
6093
+ status: live?.status
6094
+ })) {
6095
+ return;
6096
+ }
6020
6097
  updateThread(threadId, {
6021
6098
  lastError: `Setup failed: ${message}`
6022
6099
  });
@@ -6313,7 +6390,7 @@ var Orchestrator = class {
6313
6390
  let seed = null;
6314
6391
  if (!fresh.sessionId) {
6315
6392
  const prior = fresh.messages.slice(0, -1);
6316
- seed = isBrightsy ? buildSessionSeed(prior.slice(-6), { tools: "none" }) : buildSessionSeed(prior);
6393
+ seed = isBrightsy ? buildBrightsySessionSeed(prior) : buildSessionSeed(prior);
6317
6394
  }
6318
6395
  let coordinatorDirective = null;
6319
6396
  if (isOrchestration) {
@@ -6363,7 +6440,7 @@ var Orchestrator = class {
6363
6440
  )) {
6364
6441
  this.lastReconcileHealAt.set(threadId, now);
6365
6442
  const live = readThread(threadId);
6366
- if (live?.lastError?.includes("reconciled on startup") && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
6443
+ if (isStaleLastErrorDuringTurn(live?.lastError) && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
6367
6444
  setStatus(threadId, "running");
6368
6445
  this.emit({ type: "status_changed", threadId, status: "running" });
6369
6446
  }
@@ -6440,7 +6517,7 @@ var Orchestrator = class {
6440
6517
  });
6441
6518
  const retryThread = this.requireThread(threadId);
6442
6519
  const prior = retryThread.messages.slice(0, -1);
6443
- const retrySeed = buildSessionSeed(prior);
6520
+ const retrySeed = isBrightsy ? buildBrightsySessionSeed(prior) : buildSessionSeed(prior);
6444
6521
  const retryPrefix = [
6445
6522
  coordinatorDirective,
6446
6523
  worktreeDirective,
@@ -6820,9 +6897,15 @@ var Orchestrator = class {
6820
6897
  );
6821
6898
  }
6822
6899
  if (setup.exitCode !== 0 && setup.exitCode !== null) {
6823
- updateThread(thread.id, {
6824
- lastError: `Setup exited ${setup.exitCode}`
6825
- });
6900
+ const live = readThread(thread.id);
6901
+ if (shouldStampSetupLastError({
6902
+ turnInFlight: this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id),
6903
+ status: live?.status
6904
+ })) {
6905
+ updateThread(thread.id, {
6906
+ lastError: `Setup exited ${setup.exitCode}`
6907
+ });
6908
+ }
6826
6909
  }
6827
6910
  this.emit({ type: "setup_finished", threadId: thread.id, exitCode: setup.exitCode });
6828
6911
  return { exitCode: setup.exitCode, source: setup.source };
package/dist/index.cjs CHANGED
@@ -12537,6 +12537,70 @@ function buildSessionSeed(messages, opts) {
12537
12537
  "Continue from this context. Do not repeat the summary unless asked."
12538
12538
  ].join("\n");
12539
12539
  }
12540
+ function extractBrightsyContextSummary(result) {
12541
+ if (!result?.trim()) return null;
12542
+ const trimmed = result.trim();
12543
+ const lower = trimmed.toLowerCase();
12544
+ if (lower.startsWith("context summarization failed") || lower.startsWith("nothing to summarize") || lower.startsWith("no messages found") || lower.startsWith("messages are required") || lower.startsWith("agent id is required")) {
12545
+ return null;
12546
+ }
12547
+ try {
12548
+ const parsed = JSON.parse(trimmed);
12549
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
12550
+ if (parsed.error != null && typeof parsed.context_summary !== "string") {
12551
+ return null;
12552
+ }
12553
+ if (typeof parsed.context_summary === "string" && parsed.context_summary.trim()) {
12554
+ return parsed.context_summary.trim();
12555
+ }
12556
+ return null;
12557
+ }
12558
+ } catch {
12559
+ }
12560
+ if (trimmed.includes('"error"') && !trimmed.includes("context_summary")) {
12561
+ return null;
12562
+ }
12563
+ return trimmed;
12564
+ }
12565
+ function findLastBrightsyContextSummary(messages) {
12566
+ for (let i = messages.length - 1; i >= 0; i--) {
12567
+ const message = messages[i];
12568
+ if (message?.role !== "agent") continue;
12569
+ for (const part of message.parts ?? []) {
12570
+ if (part.type !== "tool" || part.name !== BRIGHTSY_SUMMARIZE_CONTEXT_TOOL) {
12571
+ continue;
12572
+ }
12573
+ if (part.status === "error") continue;
12574
+ const text5 = extractBrightsyContextSummary(part.result);
12575
+ if (text5) return { index: i, text: text5 };
12576
+ }
12577
+ }
12578
+ return null;
12579
+ }
12580
+ function messagesSinceLastBrightsyContextSummary(messages) {
12581
+ const match = findLastBrightsyContextSummary(messages);
12582
+ if (!match) return messages;
12583
+ return messages.slice(match.index + 1);
12584
+ }
12585
+ function buildBrightsySessionSeed(messages) {
12586
+ const match = findLastBrightsyContextSummary(messages);
12587
+ const tail = match ? messages.slice(match.index + 1) : messages;
12588
+ const body = formatMessagesAsTranscript(tail, { tools: "none" });
12589
+ if (!match && !body.trim()) return null;
12590
+ const blocks = [
12591
+ "Sideboard conversation context (restored after compaction or a new session):",
12592
+ ""
12593
+ ];
12594
+ if (match) {
12595
+ blocks.push(`## Prior summary
12596
+ ${match.text}`, "");
12597
+ }
12598
+ if (body.trim()) {
12599
+ blocks.push(body, "");
12600
+ }
12601
+ blocks.push("Continue from this context. Do not repeat the summary unless asked.");
12602
+ return blocks.join("\n");
12603
+ }
12540
12604
  function applyCompaction(messages, summaryText, thresholds = {}) {
12541
12605
  const { older, recent } = splitForCompaction(messages, thresholds);
12542
12606
  if (older.length === 0) return messages;
@@ -12588,7 +12652,7 @@ async function maybeCompactContext(thread, thresholds = {}, summarize = summariz
12588
12652
  olderCount: older.length
12589
12653
  };
12590
12654
  }
12591
- var CONTEXT_COMPACT_CHARS, CONTEXT_KEEP_RECENT_CHARS, CONTEXT_KEEP_RECENT_MESSAGES, CONTEXT_MIN_MESSAGES, SESSION_RESET_OCCUPANCY_TOKENS;
12655
+ var CONTEXT_COMPACT_CHARS, CONTEXT_KEEP_RECENT_CHARS, CONTEXT_KEEP_RECENT_MESSAGES, CONTEXT_MIN_MESSAGES, SESSION_RESET_OCCUPANCY_TOKENS, BRIGHTSY_SUMMARIZE_CONTEXT_TOOL;
12592
12656
  var init_context_compact = __esm({
12593
12657
  "src/composer/context-compact.ts"() {
12594
12658
  "use strict";
@@ -12601,6 +12665,7 @@ var init_context_compact = __esm({
12601
12665
  CONTEXT_KEEP_RECENT_MESSAGES = 12;
12602
12666
  CONTEXT_MIN_MESSAGES = 10;
12603
12667
  SESSION_RESET_OCCUPANCY_TOKENS = 75e4;
12668
+ BRIGHTSY_SUMMARIZE_CONTEXT_TOOL = "summarize_context";
12604
12669
  }
12605
12670
  });
12606
12671
 
@@ -15116,6 +15181,21 @@ var init_reconcile_heal = __esm({
15116
15181
  }
15117
15182
  });
15118
15183
 
15184
+ // src/orchestrator/setup-last-error.ts
15185
+ function shouldStampSetupLastError(opts) {
15186
+ if (opts.turnInFlight) return false;
15187
+ if (opts.status === "running") return false;
15188
+ return true;
15189
+ }
15190
+ function isStaleLastErrorDuringTurn(err) {
15191
+ return Boolean(err?.trim());
15192
+ }
15193
+ var init_setup_last_error = __esm({
15194
+ "src/orchestrator/setup-last-error.ts"() {
15195
+ "use strict";
15196
+ }
15197
+ });
15198
+
15119
15199
  // src/threads/fork-worktree.ts
15120
15200
  function requireThread2(idOrRef) {
15121
15201
  const thread = findThreadByRef(idOrRef) ?? null;
@@ -18020,6 +18100,7 @@ var init_orchestrator = __esm({
18020
18100
  init_repo_git_lock();
18021
18101
  init_turn_live();
18022
18102
  init_reconcile_heal();
18103
+ init_setup_last_error();
18023
18104
  init_request_review();
18024
18105
  init_fork_worktree();
18025
18106
  init_quota_failover();
@@ -18398,6 +18479,13 @@ var init_orchestrator = __esm({
18398
18479
  const message = err instanceof Error ? err.message : String(err);
18399
18480
  if (/no setup script/i.test(message)) return;
18400
18481
  if (/already running/i.test(message)) return;
18482
+ const live = readThread(threadId);
18483
+ if (!shouldStampSetupLastError({
18484
+ turnInFlight: this.activeTurns.has(threadId) || this.startingTurns.has(threadId),
18485
+ status: live?.status
18486
+ })) {
18487
+ return;
18488
+ }
18401
18489
  updateThread(threadId, {
18402
18490
  lastError: `Setup failed: ${message}`
18403
18491
  });
@@ -18694,7 +18782,7 @@ var init_orchestrator = __esm({
18694
18782
  let seed = null;
18695
18783
  if (!fresh.sessionId) {
18696
18784
  const prior = fresh.messages.slice(0, -1);
18697
- seed = isBrightsy ? buildSessionSeed(prior.slice(-6), { tools: "none" }) : buildSessionSeed(prior);
18785
+ seed = isBrightsy ? buildBrightsySessionSeed(prior) : buildSessionSeed(prior);
18698
18786
  }
18699
18787
  let coordinatorDirective = null;
18700
18788
  if (isOrchestration) {
@@ -18744,7 +18832,7 @@ var init_orchestrator = __esm({
18744
18832
  )) {
18745
18833
  this.lastReconcileHealAt.set(threadId, now);
18746
18834
  const live = readThread(threadId);
18747
- if (live?.lastError?.includes("reconciled on startup") && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
18835
+ if (isStaleLastErrorDuringTurn(live?.lastError) && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
18748
18836
  setStatus(threadId, "running");
18749
18837
  this.emit({ type: "status_changed", threadId, status: "running" });
18750
18838
  }
@@ -18821,7 +18909,7 @@ var init_orchestrator = __esm({
18821
18909
  });
18822
18910
  const retryThread = this.requireThread(threadId);
18823
18911
  const prior = retryThread.messages.slice(0, -1);
18824
- const retrySeed = buildSessionSeed(prior);
18912
+ const retrySeed = isBrightsy ? buildBrightsySessionSeed(prior) : buildSessionSeed(prior);
18825
18913
  const retryPrefix = [
18826
18914
  coordinatorDirective,
18827
18915
  worktreeDirective,
@@ -19201,9 +19289,15 @@ var init_orchestrator = __esm({
19201
19289
  );
19202
19290
  }
19203
19291
  if (setup.exitCode !== 0 && setup.exitCode !== null) {
19204
- updateThread(thread.id, {
19205
- lastError: `Setup exited ${setup.exitCode}`
19206
- });
19292
+ const live = readThread(thread.id);
19293
+ if (shouldStampSetupLastError({
19294
+ turnInFlight: this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id),
19295
+ status: live?.status
19296
+ })) {
19297
+ updateThread(thread.id, {
19298
+ lastError: `Setup exited ${setup.exitCode}`
19299
+ });
19300
+ }
19207
19301
  }
19208
19302
  this.emit({ type: "setup_finished", threadId: thread.id, exitCode: setup.exitCode });
19209
19303
  return { exitCode: setup.exitCode, source: setup.source };
@@ -20069,6 +20163,7 @@ __export(index_exports, {
20069
20163
  ATTACHMENTS_DIR: () => ATTACHMENTS_DIR,
20070
20164
  BAKED_SLACK_RELAY_URL: () => BAKED_SLACK_RELAY_URL,
20071
20165
  BRIGHTSY_MCP_ALLOWED_TOOLS: () => BRIGHTSY_MCP_ALLOWED_TOOLS,
20166
+ BRIGHTSY_SUMMARIZE_CONTEXT_TOOL: () => BRIGHTSY_SUMMARIZE_CONTEXT_TOOL,
20072
20167
  BUNDLED_LONG_RUNNING_PATH: () => BUNDLED_LONG_RUNNING_PATH,
20073
20168
  BUNDLED_SKILL_PREFIX: () => BUNDLED_SKILL_PREFIX,
20074
20169
  BrightsySideboardApi: () => BrightsySideboardApi,
@@ -20182,6 +20277,7 @@ __export(index_exports, {
20182
20277
  brightsyInjectWorktreeMcpEnabled: () => brightsyInjectWorktreeMcpEnabled,
20183
20278
  brightsyMcpAllowedTools: () => brightsyMcpAllowedTools,
20184
20279
  brightsyMcpServerName: () => brightsyMcpServerName,
20280
+ buildBrightsySessionSeed: () => buildBrightsySessionSeed,
20185
20281
  buildCachedUserContent: () => buildCachedUserContent,
20186
20282
  buildClaudeStreamJsonUserMessage: () => buildClaudeStreamJsonUserMessage,
20187
20283
  buildDiffCommentAttachment: () => buildDiffCommentAttachment,
@@ -20284,6 +20380,7 @@ __export(index_exports, {
20284
20380
  estimateOccupancyTokens: () => estimateOccupancyTokens,
20285
20381
  estimateThreadChars: () => estimateThreadChars,
20286
20382
  expandComposerPrompt: () => expandComposerPrompt,
20383
+ extractBrightsyContextSummary: () => extractBrightsyContextSummary,
20287
20384
  extractGhErrorDetail: () => extractGhErrorDetail,
20288
20385
  extractPendingPlanQuestions: () => extractPendingPlanQuestions,
20289
20386
  extractPresentedPlan: () => extractPresentedPlan,
@@ -20292,6 +20389,7 @@ __export(index_exports, {
20292
20389
  finalizeParts: () => finalizeParts,
20293
20390
  findConventionSetup: () => findConventionSetup,
20294
20391
  findInvalidCacheControlTtlOrder: () => findInvalidCacheControlTtlOrder,
20392
+ findLastBrightsyContextSummary: () => findLastBrightsyContextSummary,
20295
20393
  findLiveThreadForCreate: () => findLiveThreadForCreate,
20296
20394
  findOrphanWorktrees: () => findOrphanWorktrees,
20297
20395
  findSlackCoordinator: () => findSlackCoordinator,
@@ -20507,6 +20605,7 @@ __export(index_exports, {
20507
20605
  mergeSideboardIntoMcpServersJson: () => mergeSideboardIntoMcpServersJson,
20508
20606
  mergeUsage: () => mergeUsage,
20509
20607
  messagePartParentId: () => messagePartParentId,
20608
+ messagesSinceLastBrightsyContextSummary: () => messagesSinceLastBrightsyContextSummary,
20510
20609
  nextPastedTextName: () => nextPastedTextName,
20511
20610
  nextThinkingEffort: () => nextThinkingEffort,
20512
20611
  nonInteractiveGitProcessEnv: () => nonInteractiveGitProcessEnv,
@@ -26650,6 +26749,7 @@ init_outbound_watch();
26650
26749
  ATTACHMENTS_DIR,
26651
26750
  BAKED_SLACK_RELAY_URL,
26652
26751
  BRIGHTSY_MCP_ALLOWED_TOOLS,
26752
+ BRIGHTSY_SUMMARIZE_CONTEXT_TOOL,
26653
26753
  BUNDLED_LONG_RUNNING_PATH,
26654
26754
  BUNDLED_SKILL_PREFIX,
26655
26755
  BrightsySideboardApi,
@@ -26763,6 +26863,7 @@ init_outbound_watch();
26763
26863
  brightsyInjectWorktreeMcpEnabled,
26764
26864
  brightsyMcpAllowedTools,
26765
26865
  brightsyMcpServerName,
26866
+ buildBrightsySessionSeed,
26766
26867
  buildCachedUserContent,
26767
26868
  buildClaudeStreamJsonUserMessage,
26768
26869
  buildDiffCommentAttachment,
@@ -26865,6 +26966,7 @@ init_outbound_watch();
26865
26966
  estimateOccupancyTokens,
26866
26967
  estimateThreadChars,
26867
26968
  expandComposerPrompt,
26969
+ extractBrightsyContextSummary,
26868
26970
  extractGhErrorDetail,
26869
26971
  extractPendingPlanQuestions,
26870
26972
  extractPresentedPlan,
@@ -26873,6 +26975,7 @@ init_outbound_watch();
26873
26975
  finalizeParts,
26874
26976
  findConventionSetup,
26875
26977
  findInvalidCacheControlTtlOrder,
26978
+ findLastBrightsyContextSummary,
26876
26979
  findLiveThreadForCreate,
26877
26980
  findOrphanWorktrees,
26878
26981
  findSlackCoordinator,
@@ -27088,6 +27191,7 @@ init_outbound_watch();
27088
27191
  mergeSideboardIntoMcpServersJson,
27089
27192
  mergeUsage,
27090
27193
  messagePartParentId,
27194
+ messagesSinceLastBrightsyContextSummary,
27091
27195
  nextPastedTextName,
27092
27196
  nextThinkingEffort,
27093
27197
  nonInteractiveGitProcessEnv,
package/dist/index.d.cts CHANGED
@@ -2348,8 +2348,9 @@ declare function listBrightsyChatTargets(): Promise<BrightsyChatTargets>;
2348
2348
  /**
2349
2349
  * Brightsy hosted-agent adapter. `brightsy chat --json` emits NDJSON events
2350
2350
  * (text deltas, tool output, usage, error, done); the message is piped on
2351
- * stdin. The CLI has no session resume, so resolveSessionId always returns
2352
- * null and Sideboard seeds each turn from thread history. Brightsy agents run
2351
+ * stdin. The CLI has no session resume (`chat` is a stateless completion), so
2352
+ * resolveSessionId always returns null and Sideboard seeds each turn from the
2353
+ * last `summarize_context` tool through the current turn. Brightsy agents run
2353
2354
  * server-side — they converse about the worktree but never edit local files.
2354
2355
  * All Brightsy agents/models use OpenRouter chat-completions syntax; the CLI
2355
2356
  * owns that wire format.
@@ -3238,6 +3239,30 @@ declare function formatMessagesAsTranscript(messages: ThreadMessage[], opts?: {
3238
3239
  declare function buildSessionSeed(messages: ThreadMessage[], opts?: {
3239
3240
  tools?: TranscriptToolDetail;
3240
3241
  }): string | null;
3242
+ /** Brightsy server tool that compresses chat history (`context_summary` payload). */
3243
+ declare const BRIGHTSY_SUMMARIZE_CONTEXT_TOOL = "summarize_context";
3244
+ /**
3245
+ * Pull the summary text from a Brightsy `summarize_context` tool result.
3246
+ * Successful payloads are `{ context_summary: "..." }`; failures are skipped.
3247
+ */
3248
+ declare function extractBrightsyContextSummary(result: string | undefined): string | null;
3249
+ declare function findLastBrightsyContextSummary(messages: ThreadMessage[]): {
3250
+ index: number;
3251
+ text: string;
3252
+ } | null;
3253
+ /**
3254
+ * Messages Brightsy should see after its last successful `summarize_context`
3255
+ * tool (everything after that tool row). Matches Brightsy's own prompt
3256
+ * builder: drop history before the tool result, keep the tail. No last-N cap.
3257
+ * If the tool has never succeeded, return the full history.
3258
+ */
3259
+ declare function messagesSinceLastBrightsyContextSummary(messages: ThreadMessage[]): ThreadMessage[];
3260
+ /**
3261
+ * Brightsy `chat` is a stateless completion (one stdin blob, no --resume).
3262
+ * Seed the last `summarize_context` result plus every later turn, text-only
3263
+ * so other tool dumps do not empty-complete.
3264
+ */
3265
+ declare function buildBrightsySessionSeed(messages: ThreadMessage[]): string | null;
3241
3266
  declare function applyCompaction(messages: ThreadMessage[], summaryText: string, thresholds?: CompactThresholds): ThreadMessage[];
3242
3267
  interface CompactResult {
3243
3268
  didCompact: boolean;
@@ -5421,4 +5446,4 @@ declare function pollSlackOutboundWatches(opts?: {
5421
5446
  now?: number;
5422
5447
  }): Promise<void>;
5423
5448
 
5424
- export { ABLETIME_MCP_PATH, AGENT_GIT_ACTIONS, AGENT_RUNNER_MAX_OLD_SPACE_MB, ATTACHMENTS_DIR, type AbleTimeAssignedIssuesResult, type AbleTimeMcpToolName, type AbleTimeOrientation, type AbleTimeProject, type AbleTimeTask, type AbleTimeViewer, type ActiveRun, type AddBoardPinInput, 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, BUNDLED_LONG_RUNNING_PATH, BUNDLED_SKILL_PREFIX, type BoardPin, type BranchInfo, type BrightsyAccount, type BrightsyChatTarget, type BrightsyChatTargets, type BrightsyCloudConnectAgent, type BrightsyHarnessSettings, type BrightsySession, BrightsySideboardApi, type BrightsyTeamTargets, CHARS_PER_CONTEXT_TOKEN, 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, DEFAULT_ABLETIME_HOST, DEFAULT_WORKTREE_SORT, 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, HOME_BOARD_CACHE_TTL_MS, type HarnessId, type HomeBoardLoaded, type HomeBoardRemoteData, ISSUE_SOURCE_LABELS, type InitStackFromThreadInput, type IntegrationsSettings, type IpcApi, type IssueCycleInfo, 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, LONG_RUNNING_SKILL_COMMAND, type LandPreview, type LandResult, type LinearAssignedIssuesResult, type LinearComment, type LinearIssue, LinearOAuthCancelledError, type LinearTeam, type LinearTeamsResult, type LinearWorkflowState, type ListIssuesResult, MAX_ANTHROPIC_CACHE_CONTROL_BLOCKS, type McpServerStatus, type MessagePart, OPTIONAL_SERVICES, OPTIONAL_SERVICE_IDS, ORCHESTRATOR_AGENT_KINDS, type OpenPrStackLayersInput, type OpenStackLayerInput, type OpenStackLayerResult, type OptionalServiceCliStatus, type OptionalServiceId, type OptionalServiceSpec, 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, PLAN_QUESTION_ANSWERS_PREFIX, 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, type WorktreeSortMode, abletimeMcpRequest, abletimeMcpUrl, ackSlackInboundSeen, addBoardPin, addPrStackLayer, addStackLayerFromThread, addWorkspace, adoptThread, agentGitPrompt, allAdapters, allocatePort, allocatePortRange, allocateTeamName, allocateTeamSlug, appDataDir, appSettingsPath, appendIndexedGitConfig, appendMessage, applyAgentEvent, applyAgentRunnerHeapEnv, applyAppEnvironment, applyCompaction, applyForwardOccupancy, applyGithubGitAuthEnv, applyPromptCacheTtlEnv, applyThreadIntoMain, applyTurnUsage, armSchedules, assertOrchestratorCapableAgent, attachmentFromAbsolutePath, attachmentsFromBuffers, attachmentsFromWorktreePaths, attachmentsGitignoreBody, autoArchiveOnMergeEnabled, autoCleanupOrphansEnabled, autoRenameBranchEnabled, autoRunAfterSetupEnabled, branchDisplayLabel, brightsyAccessTokenNeedsRefresh, brightsyAdapter, brightsyCloudConnectAgent, brightsyCloudConnectEnabled, brightsyConfigPath, brightsyInjectWorktreeMcpEnabled, brightsyMcpAllowedTools, brightsyMcpServerName, buildCachedUserContent, buildClaudeStreamJsonUserMessage, buildDiffCommentAttachment, buildForkTranscriptAttachment, buildPastedTextAttachment, buildReviewRequestAttachment, buildSessionSeed, buildWorkspaceScriptEnv, caffeinateHoldPath, caffeinateWhileCloudConnectEnabled, caffeinateWhileRunningEnabled, caffeinateWhileSchedulesEnabled, caffeinateWhileSlackListenEnabled, callAbleTimeTool, canonicalizeRepoPath, captureLoginEnv, captureTurnBaseline, checkoutPrStackLayer, childEnvWithAppSettings, claimDesktopHost, classifyWorktreeColumn, claudeAdapter, claudeChromeEnabled, claudeUserSettingsPath, cleanupOrphanWorktrees, clearBoardPins, clearHomeBoardCache, cloneRepoIntoSideboard, codexAdapter, codexSandboxWritableRootsArgs, codexUnattendedGitConfigArgs, coerceOrchestratorAgent, collectTakenTeamSlugs, commentLinearIssue, commitAll, computeNextRunAt, conductorBundledBinDir, conductorDbPath, confirmLand, connectBrightsyTeam, connectOptionalService, connectSlackToken, connectedOptionalServices, contextTokens, coordinatorSystemPrompt, coordinatorTurnReminder, copyConfiguredFiles, countCacheControlBlocks, cowboyModeEnabled, createAbleTimeTask, createChatTab, createEmptyThread, createExistingBranchWorktree, createGlobalChat, createLinearIssue, createLinearPkce, createOrUpdatePr, createPrStack, createSchedule, createThread, createThreadWorktree, currentBranch, cursorAdapter, cursorSdkMessageToEvents, decodeBrightsyTarget, defaultScheduleName, deleteBranchOnPurgeEnabled, deleteSchedule, deleteThreadRecord, desktopHostPidPath, detectAgents, detectGhStack, detectLocalMergeConflicts, detectOptionalServiceClis, disconnectAbleTimeConnection, disconnectBrightsyTeam, disconnectLinear, disconnectLinearConnection, disconnectOptionalService, disconnectSlackWorkspace, discoverSkills, dropCachedPrefixOnResume, emptyPublicIntegrations, encodeBrightsyTarget, enrichPathWithNpmGlobalBin, enrichWorkspacesWithGithub, ensureAbleTimeTask, ensureAgentPath, ensureBrightsyLocalConfigFresh, ensureCloudCoordinator, ensureConnectedBrightsyTeamTokens, ensureGhPreferOrigin, ensureGlobalCoordinatorCwd, ensureReviewRequestFile, ensureReviewSkillFile, ensureSlackCoordinator, ensureSlackDeviceIdentity, ensureWorkspace, estimateMessageChars, estimateOccupancyTokens, estimateThreadChars, expandComposerPrompt, extractGhErrorDetail, extractPendingPlanQuestions, extractPresentedPlan, extractiveSummary, fetchPrHead, finalizeParts, findConventionSetup, findInvalidCacheControlTtlOrder, findLiveThreadForCreate, findOrphanWorktrees, findSlackCoordinator, findThreadByRef, findThreadForStackLayer, fireSchedule, flattenTurnInput, forkChatTab, forkMessageSlice, forkThreadWorktree, formatAgentInstructions, formatArtifactDirective, formatBrightsyFetchError, formatDetachedJobInvoke, formatFetchError, formatGhLandError, formatGitAuthModeDirective, formatIpcInvokeError, formatLongRunningDirective, formatLongRunningReminder, formatMergePrError, formatMessagesAsTranscript, formatOptionalServicesDirective, formatOptionalServicesReminder, formatPlanQuestionAnswers, formatPlanQuestionsForChat, formatProcessGuideDirective, formatRateLimitResetHint, formatRenameBranchDirective, formatScheduleWhen, formatScheduledPrompt, formatSlackExternalReplyPrompt, formatSlackInboundPrompt, formatSlackRepliesForTurn, formatSlackReplyContinuePrompt, formatSlackSignedReply, formatSlackWorkingText, formatTranscriptMarkdown, formatUiReminder, formatWorkspaceInventory, formatWorktreeDirective, formatWorktreeReminder, forwardContextUsage, forwardOccupancyTokens, fromInclusiveInputUsage, getAbleTimeAccessToken, getAbleTimeHost, getAbleTimeOrientation, getAbleTimeTask, getAdapter, getAgentSetupInfo, getBrightsySession, getCaffeinateHold, getDefaultAgent, getDefaultEffort, getDefaultFast, getDefaultModel, getDefaultRunScript, getDiff, getDiffSummary, getGitHubStatus, getGithubGitAuthMode, getGithubPat, getHomeBoardInputs, getIssueSource, getLinearApiKey, getLinearAuthToken, getLinearIssue, getOrchestrator, getPr, getPrChecks, getPrDetails, getPrForHeadBranch, getPrMeta, getPrStack, getRepoSetupInfo, getRunMode, getRunScript, getSchedule, getSlackWorkspace, gh, ghHeadRef, ghRepoSelectArgs, git, githubAgentGitEnv, globalAgentCwd, groupHomeBoardWorktrees, handleSlackInbound, harnessEnvKey, hasBakedLinearOAuth, hasBakedSlackOAuth, hasConductorHook, hasConventionSetup, hasCursorWorktreeSetup, hasEnabledSchedules, hasRepoHook, hasWorkspaceHook, healOrchestrationSoccerTitles, httpFetch, importConductorWorkspace, importConductorWorkspaceAsync, initPrStack, initStackFromThread, initializeGitRepository, inspectGitWorktree, installAgent, installNpmGlobalPackage, installOptionalServiceCli, interruptSlackCoordinatorForInbound, invalidateThreadListCache, isAbleTimeConnected, isAskUserToolName, isBrightsyConnected, isBrightsyNdjsonLine, isCloudCoordinatorThread, isConductorBundledCli, isCowboyThread, isCursorAutoModel, isDefaultishSourceRef, isDesktopHostAlive, isDirty, isGhRateLimitError, isGlobalRepoPath, isGlobalThread, isHomeBoardThread, isImageFilePath, isInPrStack, isInboundForThisDesktop, isIssueSourceConnected, isLinearConnected, isLinearOAuthCancelled, isOptionalServiceId, isOrchestratorCapableAgent, isOrchestratorThread, isPidAlive, isPlaceholderBranch, isPlanQuestionAnswersMessage, isPollWrapperToolName, isPrNotMergeableError, isPresentPlanToolName, isPrimaryCheckoutThread, isSessionQuotaLimit, isShellToolName, isSideboardScratchPath, isSlackCoordinatorThread, isSlackExternalReplyPrompt, isSlackOAuthCancelled, isSubagentToolName, isThinkingEffort, isThisProcessDesktopHost, isThreadCaffeinated, isThreadRecordFile, isWorkspaceScratchPath, issueAttachmentForAbleTimeTask, issueSourceLabel, lastRequestOccupancy, latestPendingPlanQuestions, linearAuthorizationHeader, linearCycleIsActive, linearGraphql, linearOAuthAuthorizeUrl, linearOAuthCredentials, listAbleTimeAssignedIssues, listAbleTimeProjects, listAbleTimeTasks, listAgentSetupInfo, listBoardPins, listBranchCommits, listBranches, listBrightsyAccounts, listBrightsyChatTargets, listCodexModels, listConductorWorkspaces, listConnectedBrightsyTeams, listCursorModels, listGitHubIssues, listGlobalThreads, listIssues, listLinearAssignedIssues, listLinearIssues, listLinearIssuesDirect, listLinearTeams, listModelsForAgent, listOpencodeModels, listPrs, listRunScripts, listSchedules, listSlackOutboundWatches, listSlackWorkspaces, listThreads, listWorkspaces, listWorktreeFiles, listWorktrees, liveActivitySummary, loadAgentInstructions, loadAppSettings, loadBrightsyConfig, loadConductorSettings, loadHomeBoardInputs, loadRepoSettings, loadWorkspaceSettings, locksDir, loginAgent, lookupSoccerTeam, mapAbleTimeTask, maxConcurrentAgents, maybeCompactContext, mcpAllowTools, mcpAuthWarnings, mergeAgentGitAuthEnv, mergePr, mergePrStack, mergeSideboardIntoMcpServersJson, mergeUsage, messagePartParentId, nextPastedTextName, nextThinkingEffort, nonInteractiveGitProcessEnv, normalizeAbleTimeHost, normalizeParseResult, normalizeServiceOrigin, normalizeThinkingEffort, normalizeThread, normalizeTurnInput, normalizeWorktreePath, openInSystemTerminal, openPrStackLayers, openStackLayer, opencodeAdapter, optionalServiceConnected, optionalServiceSpec, orchestrationQuotaFallbackAgent, orchestrationQuotaOnLimit, orchestrationTitleNeedsSoccerNickname, orchestratorSessionPoisonedByBuiltins, originGhRepoEnv, packagedDetachedJobPath, parseCursorRunnerLine, parseDurationMs, parseForceStopMessage, parseGhStackViewJson, parseGithubSlugFromRemoteUrl, parseMcpList, parsePlanQuestionsInput, parseSessionQuotaResetAt, parseSlackRelayClientMessage, parseSlackRelayServerMessage, partsToAssistantText, pastedTextStats, pendingSlackExternalReplies, permissionMode, persistPendingFileAttachments, persistVaultKeyInKeychain, planFileAbs, planQuestionsSignature, pollSlackOutboundWatches, posixShellSingleQuote, preferredCursorCostCents, prepareTerminalCommand, previewLand, promptMentionsBrightsy, pushBranch, readExistingReviewRequestFile, readKeychainVaultKey, readPlanFile, readSkillBody, readThread, readWorktreeFile, readWorktreeFileForUpload, readWorktreeInclude, recordScheduleRun, recordSlackOutboundWatch, refreshBrightsyAccessToken, refreshGitHubAuth, registerPackagedUserMcpClients, releaseCaffeinateHoldForThread, releaseDesktopHost, removeBoardPin, removeWorkspace, removeWorktree, repoSlug, requestOccupancy, requestReview, requireAgent, resetGhStackDetectCache, resetGithubAgentTokenMemo, resolveAgentExecutable, resolveAgentGitAuthEnv, resolveClaudeExecutable, resolveCodexGitWritableRoots, resolveCommandBinarySync, resolveConductorCursorAgentId, resolveCursorModelId, resolveDefaultBranch, resolveDetachedJobScript, resolveDiffBaseRef, resolveEffectiveIssueSource, resolveFilesToCopy, resolveGhAuthToken, resolveGitDirsForLockRecovery, resolveGithubAgentToken, resolveGithubRepoSlug, resolveLinearState, resolveLinearTeam, resolveLoginCommand, resolveNewThreadOptions, resolvePlanMarkdown, resolvePrSelector, resolvePrSelectors, resolveQuotaFallbackAgent, resolveRepoRoot, resolveReviewGuidelines, resolveScheduleThreadId, resolveSlackListenMode, resolveThreadDefaults, resolveThreadEffort, resolveVaultKey, resolveWorktreeStartPoint, rewriteAbleTimeError, rewriteLinearError, run, runArchiveScript, runCloudConnect, runConventionSetup, runCursorWorktreeSetup, runSetupScript, runSlackListen, runSlackRelayClient, runWorkspaceSetup, sameWorktreePath, sanitizeMcpServerName, saveAbleTimeConnection, saveAppSettings, saveLinearOAuth, schedulesPath, scrubGithubTokensFromChildEnv, searchAbleTimeTasks, 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, taskUrl, thinkingEffortBars, thinkingEffortLabel, thisProcessShouldDrainAgentQueues, threadDisplayLabel, threadFilePath, threadHasCompactedContext, threadLivePath, threadLockPath, threadRequestsBrightsyMcp, threadsDir, threadsSharingWorktree, toAbleTimeIssueInfo, toPublicAppSettings, toolActivityLine, toolDescription, toolDetail, toolFilePath, totalTokens, turnCostUsdFromCursorUsage, updateAdvancedSettings, updateAgentExecutable, updateAppEnvironment, updateBrightsySettings, updateClaudeSettings, updateCodexSettings, updateDefaultsSettings, updateIntegrationsSettings, updateLinearIssue, updateOpencodeSettings, updateSchedule, updateThread, userClaudeMcpConfigPath, userCursorMcpConfigPath, validateLinearApiKey, verifyAbleTimeConnection, verifyOptionalService, visibleToolRowDetail, waitForPidExit, warmGithubAgentAuth, whichOnPath, withAgentInstructions, withEventParentId, withEventsParentId, withExportedPath, withMaxOldSpaceSize, withThreadLock, workspaceSettingsSourceLabel, worktreeBoardStatus, worktreeCleanupSettings, worktreeDisplayLabel, worktreeDisplayLabelForGroup, worktreeNameFromPath, worktreesRoot, wrapReviewSkillMarkdown, writeInjectedMcpConfig, writePlanFile, writeThread, writeWorktreeFile };
5449
+ export { ABLETIME_MCP_PATH, AGENT_GIT_ACTIONS, AGENT_RUNNER_MAX_OLD_SPACE_MB, ATTACHMENTS_DIR, type AbleTimeAssignedIssuesResult, type AbleTimeMcpToolName, type AbleTimeOrientation, type AbleTimeProject, type AbleTimeTask, type AbleTimeViewer, type ActiveRun, type AddBoardPinInput, 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, BRIGHTSY_SUMMARIZE_CONTEXT_TOOL, BUNDLED_LONG_RUNNING_PATH, BUNDLED_SKILL_PREFIX, type BoardPin, type BranchInfo, type BrightsyAccount, type BrightsyChatTarget, type BrightsyChatTargets, type BrightsyCloudConnectAgent, type BrightsyHarnessSettings, type BrightsySession, BrightsySideboardApi, type BrightsyTeamTargets, CHARS_PER_CONTEXT_TOKEN, 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, DEFAULT_ABLETIME_HOST, DEFAULT_WORKTREE_SORT, 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, HOME_BOARD_CACHE_TTL_MS, type HarnessId, type HomeBoardLoaded, type HomeBoardRemoteData, ISSUE_SOURCE_LABELS, type InitStackFromThreadInput, type IntegrationsSettings, type IpcApi, type IssueCycleInfo, 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, LONG_RUNNING_SKILL_COMMAND, type LandPreview, type LandResult, type LinearAssignedIssuesResult, type LinearComment, type LinearIssue, LinearOAuthCancelledError, type LinearTeam, type LinearTeamsResult, type LinearWorkflowState, type ListIssuesResult, MAX_ANTHROPIC_CACHE_CONTROL_BLOCKS, type McpServerStatus, type MessagePart, OPTIONAL_SERVICES, OPTIONAL_SERVICE_IDS, ORCHESTRATOR_AGENT_KINDS, type OpenPrStackLayersInput, type OpenStackLayerInput, type OpenStackLayerResult, type OptionalServiceCliStatus, type OptionalServiceId, type OptionalServiceSpec, 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, PLAN_QUESTION_ANSWERS_PREFIX, 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, type WorktreeSortMode, abletimeMcpRequest, abletimeMcpUrl, ackSlackInboundSeen, addBoardPin, addPrStackLayer, addStackLayerFromThread, addWorkspace, adoptThread, agentGitPrompt, allAdapters, allocatePort, allocatePortRange, allocateTeamName, allocateTeamSlug, appDataDir, appSettingsPath, appendIndexedGitConfig, appendMessage, applyAgentEvent, applyAgentRunnerHeapEnv, applyAppEnvironment, applyCompaction, applyForwardOccupancy, applyGithubGitAuthEnv, applyPromptCacheTtlEnv, applyThreadIntoMain, applyTurnUsage, armSchedules, assertOrchestratorCapableAgent, attachmentFromAbsolutePath, attachmentsFromBuffers, attachmentsFromWorktreePaths, attachmentsGitignoreBody, autoArchiveOnMergeEnabled, autoCleanupOrphansEnabled, autoRenameBranchEnabled, autoRunAfterSetupEnabled, branchDisplayLabel, brightsyAccessTokenNeedsRefresh, brightsyAdapter, brightsyCloudConnectAgent, brightsyCloudConnectEnabled, brightsyConfigPath, brightsyInjectWorktreeMcpEnabled, brightsyMcpAllowedTools, brightsyMcpServerName, buildBrightsySessionSeed, buildCachedUserContent, buildClaudeStreamJsonUserMessage, buildDiffCommentAttachment, buildForkTranscriptAttachment, buildPastedTextAttachment, buildReviewRequestAttachment, buildSessionSeed, buildWorkspaceScriptEnv, caffeinateHoldPath, caffeinateWhileCloudConnectEnabled, caffeinateWhileRunningEnabled, caffeinateWhileSchedulesEnabled, caffeinateWhileSlackListenEnabled, callAbleTimeTool, canonicalizeRepoPath, captureLoginEnv, captureTurnBaseline, checkoutPrStackLayer, childEnvWithAppSettings, claimDesktopHost, classifyWorktreeColumn, claudeAdapter, claudeChromeEnabled, claudeUserSettingsPath, cleanupOrphanWorktrees, clearBoardPins, clearHomeBoardCache, cloneRepoIntoSideboard, codexAdapter, codexSandboxWritableRootsArgs, codexUnattendedGitConfigArgs, coerceOrchestratorAgent, collectTakenTeamSlugs, commentLinearIssue, commitAll, computeNextRunAt, conductorBundledBinDir, conductorDbPath, confirmLand, connectBrightsyTeam, connectOptionalService, connectSlackToken, connectedOptionalServices, contextTokens, coordinatorSystemPrompt, coordinatorTurnReminder, copyConfiguredFiles, countCacheControlBlocks, cowboyModeEnabled, createAbleTimeTask, createChatTab, createEmptyThread, createExistingBranchWorktree, createGlobalChat, createLinearIssue, createLinearPkce, createOrUpdatePr, createPrStack, createSchedule, createThread, createThreadWorktree, currentBranch, cursorAdapter, cursorSdkMessageToEvents, decodeBrightsyTarget, defaultScheduleName, deleteBranchOnPurgeEnabled, deleteSchedule, deleteThreadRecord, desktopHostPidPath, detectAgents, detectGhStack, detectLocalMergeConflicts, detectOptionalServiceClis, disconnectAbleTimeConnection, disconnectBrightsyTeam, disconnectLinear, disconnectLinearConnection, disconnectOptionalService, disconnectSlackWorkspace, discoverSkills, dropCachedPrefixOnResume, emptyPublicIntegrations, encodeBrightsyTarget, enrichPathWithNpmGlobalBin, enrichWorkspacesWithGithub, ensureAbleTimeTask, ensureAgentPath, ensureBrightsyLocalConfigFresh, ensureCloudCoordinator, ensureConnectedBrightsyTeamTokens, ensureGhPreferOrigin, ensureGlobalCoordinatorCwd, ensureReviewRequestFile, ensureReviewSkillFile, ensureSlackCoordinator, ensureSlackDeviceIdentity, ensureWorkspace, estimateMessageChars, estimateOccupancyTokens, estimateThreadChars, expandComposerPrompt, extractBrightsyContextSummary, extractGhErrorDetail, extractPendingPlanQuestions, extractPresentedPlan, extractiveSummary, fetchPrHead, finalizeParts, findConventionSetup, findInvalidCacheControlTtlOrder, findLastBrightsyContextSummary, findLiveThreadForCreate, findOrphanWorktrees, findSlackCoordinator, findThreadByRef, findThreadForStackLayer, fireSchedule, flattenTurnInput, forkChatTab, forkMessageSlice, forkThreadWorktree, formatAgentInstructions, formatArtifactDirective, formatBrightsyFetchError, formatDetachedJobInvoke, formatFetchError, formatGhLandError, formatGitAuthModeDirective, formatIpcInvokeError, formatLongRunningDirective, formatLongRunningReminder, formatMergePrError, formatMessagesAsTranscript, formatOptionalServicesDirective, formatOptionalServicesReminder, formatPlanQuestionAnswers, formatPlanQuestionsForChat, formatProcessGuideDirective, formatRateLimitResetHint, formatRenameBranchDirective, formatScheduleWhen, formatScheduledPrompt, formatSlackExternalReplyPrompt, formatSlackInboundPrompt, formatSlackRepliesForTurn, formatSlackReplyContinuePrompt, formatSlackSignedReply, formatSlackWorkingText, formatTranscriptMarkdown, formatUiReminder, formatWorkspaceInventory, formatWorktreeDirective, formatWorktreeReminder, forwardContextUsage, forwardOccupancyTokens, fromInclusiveInputUsage, getAbleTimeAccessToken, getAbleTimeHost, getAbleTimeOrientation, getAbleTimeTask, getAdapter, getAgentSetupInfo, getBrightsySession, getCaffeinateHold, getDefaultAgent, getDefaultEffort, getDefaultFast, getDefaultModel, getDefaultRunScript, getDiff, getDiffSummary, getGitHubStatus, getGithubGitAuthMode, getGithubPat, getHomeBoardInputs, getIssueSource, getLinearApiKey, getLinearAuthToken, getLinearIssue, getOrchestrator, getPr, getPrChecks, getPrDetails, getPrForHeadBranch, getPrMeta, getPrStack, getRepoSetupInfo, getRunMode, getRunScript, getSchedule, getSlackWorkspace, gh, ghHeadRef, ghRepoSelectArgs, git, githubAgentGitEnv, globalAgentCwd, groupHomeBoardWorktrees, handleSlackInbound, harnessEnvKey, hasBakedLinearOAuth, hasBakedSlackOAuth, hasConductorHook, hasConventionSetup, hasCursorWorktreeSetup, hasEnabledSchedules, hasRepoHook, hasWorkspaceHook, healOrchestrationSoccerTitles, httpFetch, importConductorWorkspace, importConductorWorkspaceAsync, initPrStack, initStackFromThread, initializeGitRepository, inspectGitWorktree, installAgent, installNpmGlobalPackage, installOptionalServiceCli, interruptSlackCoordinatorForInbound, invalidateThreadListCache, isAbleTimeConnected, isAskUserToolName, isBrightsyConnected, isBrightsyNdjsonLine, isCloudCoordinatorThread, isConductorBundledCli, isCowboyThread, isCursorAutoModel, isDefaultishSourceRef, isDesktopHostAlive, isDirty, isGhRateLimitError, isGlobalRepoPath, isGlobalThread, isHomeBoardThread, isImageFilePath, isInPrStack, isInboundForThisDesktop, isIssueSourceConnected, isLinearConnected, isLinearOAuthCancelled, isOptionalServiceId, isOrchestratorCapableAgent, isOrchestratorThread, isPidAlive, isPlaceholderBranch, isPlanQuestionAnswersMessage, isPollWrapperToolName, isPrNotMergeableError, isPresentPlanToolName, isPrimaryCheckoutThread, isSessionQuotaLimit, isShellToolName, isSideboardScratchPath, isSlackCoordinatorThread, isSlackExternalReplyPrompt, isSlackOAuthCancelled, isSubagentToolName, isThinkingEffort, isThisProcessDesktopHost, isThreadCaffeinated, isThreadRecordFile, isWorkspaceScratchPath, issueAttachmentForAbleTimeTask, issueSourceLabel, lastRequestOccupancy, latestPendingPlanQuestions, linearAuthorizationHeader, linearCycleIsActive, linearGraphql, linearOAuthAuthorizeUrl, linearOAuthCredentials, listAbleTimeAssignedIssues, listAbleTimeProjects, listAbleTimeTasks, listAgentSetupInfo, listBoardPins, listBranchCommits, listBranches, listBrightsyAccounts, listBrightsyChatTargets, listCodexModels, listConductorWorkspaces, listConnectedBrightsyTeams, listCursorModels, listGitHubIssues, listGlobalThreads, listIssues, listLinearAssignedIssues, listLinearIssues, listLinearIssuesDirect, listLinearTeams, listModelsForAgent, listOpencodeModels, listPrs, listRunScripts, listSchedules, listSlackOutboundWatches, listSlackWorkspaces, listThreads, listWorkspaces, listWorktreeFiles, listWorktrees, liveActivitySummary, loadAgentInstructions, loadAppSettings, loadBrightsyConfig, loadConductorSettings, loadHomeBoardInputs, loadRepoSettings, loadWorkspaceSettings, locksDir, loginAgent, lookupSoccerTeam, mapAbleTimeTask, maxConcurrentAgents, maybeCompactContext, mcpAllowTools, mcpAuthWarnings, mergeAgentGitAuthEnv, mergePr, mergePrStack, mergeSideboardIntoMcpServersJson, mergeUsage, messagePartParentId, messagesSinceLastBrightsyContextSummary, nextPastedTextName, nextThinkingEffort, nonInteractiveGitProcessEnv, normalizeAbleTimeHost, normalizeParseResult, normalizeServiceOrigin, normalizeThinkingEffort, normalizeThread, normalizeTurnInput, normalizeWorktreePath, openInSystemTerminal, openPrStackLayers, openStackLayer, opencodeAdapter, optionalServiceConnected, optionalServiceSpec, orchestrationQuotaFallbackAgent, orchestrationQuotaOnLimit, orchestrationTitleNeedsSoccerNickname, orchestratorSessionPoisonedByBuiltins, originGhRepoEnv, packagedDetachedJobPath, parseCursorRunnerLine, parseDurationMs, parseForceStopMessage, parseGhStackViewJson, parseGithubSlugFromRemoteUrl, parseMcpList, parsePlanQuestionsInput, parseSessionQuotaResetAt, parseSlackRelayClientMessage, parseSlackRelayServerMessage, partsToAssistantText, pastedTextStats, pendingSlackExternalReplies, permissionMode, persistPendingFileAttachments, persistVaultKeyInKeychain, planFileAbs, planQuestionsSignature, pollSlackOutboundWatches, posixShellSingleQuote, preferredCursorCostCents, prepareTerminalCommand, previewLand, promptMentionsBrightsy, pushBranch, readExistingReviewRequestFile, readKeychainVaultKey, readPlanFile, readSkillBody, readThread, readWorktreeFile, readWorktreeFileForUpload, readWorktreeInclude, recordScheduleRun, recordSlackOutboundWatch, refreshBrightsyAccessToken, refreshGitHubAuth, registerPackagedUserMcpClients, releaseCaffeinateHoldForThread, releaseDesktopHost, removeBoardPin, removeWorkspace, removeWorktree, repoSlug, requestOccupancy, requestReview, requireAgent, resetGhStackDetectCache, resetGithubAgentTokenMemo, resolveAgentExecutable, resolveAgentGitAuthEnv, resolveClaudeExecutable, resolveCodexGitWritableRoots, resolveCommandBinarySync, resolveConductorCursorAgentId, resolveCursorModelId, resolveDefaultBranch, resolveDetachedJobScript, resolveDiffBaseRef, resolveEffectiveIssueSource, resolveFilesToCopy, resolveGhAuthToken, resolveGitDirsForLockRecovery, resolveGithubAgentToken, resolveGithubRepoSlug, resolveLinearState, resolveLinearTeam, resolveLoginCommand, resolveNewThreadOptions, resolvePlanMarkdown, resolvePrSelector, resolvePrSelectors, resolveQuotaFallbackAgent, resolveRepoRoot, resolveReviewGuidelines, resolveScheduleThreadId, resolveSlackListenMode, resolveThreadDefaults, resolveThreadEffort, resolveVaultKey, resolveWorktreeStartPoint, rewriteAbleTimeError, rewriteLinearError, run, runArchiveScript, runCloudConnect, runConventionSetup, runCursorWorktreeSetup, runSetupScript, runSlackListen, runSlackRelayClient, runWorkspaceSetup, sameWorktreePath, sanitizeMcpServerName, saveAbleTimeConnection, saveAppSettings, saveLinearOAuth, schedulesPath, scrubGithubTokensFromChildEnv, searchAbleTimeTasks, 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, taskUrl, thinkingEffortBars, thinkingEffortLabel, thisProcessShouldDrainAgentQueues, threadDisplayLabel, threadFilePath, threadHasCompactedContext, threadLivePath, threadLockPath, threadRequestsBrightsyMcp, threadsDir, threadsSharingWorktree, toAbleTimeIssueInfo, toPublicAppSettings, toolActivityLine, toolDescription, toolDetail, toolFilePath, totalTokens, turnCostUsdFromCursorUsage, updateAdvancedSettings, updateAgentExecutable, updateAppEnvironment, updateBrightsySettings, updateClaudeSettings, updateCodexSettings, updateDefaultsSettings, updateIntegrationsSettings, updateLinearIssue, updateOpencodeSettings, updateSchedule, updateThread, userClaudeMcpConfigPath, userCursorMcpConfigPath, validateLinearApiKey, verifyAbleTimeConnection, verifyOptionalService, visibleToolRowDetail, waitForPidExit, warmGithubAgentAuth, whichOnPath, withAgentInstructions, withEventParentId, withEventsParentId, withExportedPath, withMaxOldSpaceSize, withThreadLock, workspaceSettingsSourceLabel, worktreeBoardStatus, worktreeCleanupSettings, worktreeDisplayLabel, worktreeDisplayLabelForGroup, worktreeNameFromPath, worktreesRoot, wrapReviewSkillMarkdown, writeInjectedMcpConfig, writePlanFile, writeThread, writeWorktreeFile };
package/dist/index.d.ts CHANGED
@@ -2348,8 +2348,9 @@ declare function listBrightsyChatTargets(): Promise<BrightsyChatTargets>;
2348
2348
  /**
2349
2349
  * Brightsy hosted-agent adapter. `brightsy chat --json` emits NDJSON events
2350
2350
  * (text deltas, tool output, usage, error, done); the message is piped on
2351
- * stdin. The CLI has no session resume, so resolveSessionId always returns
2352
- * null and Sideboard seeds each turn from thread history. Brightsy agents run
2351
+ * stdin. The CLI has no session resume (`chat` is a stateless completion), so
2352
+ * resolveSessionId always returns null and Sideboard seeds each turn from the
2353
+ * last `summarize_context` tool through the current turn. Brightsy agents run
2353
2354
  * server-side — they converse about the worktree but never edit local files.
2354
2355
  * All Brightsy agents/models use OpenRouter chat-completions syntax; the CLI
2355
2356
  * owns that wire format.
@@ -3238,6 +3239,30 @@ declare function formatMessagesAsTranscript(messages: ThreadMessage[], opts?: {
3238
3239
  declare function buildSessionSeed(messages: ThreadMessage[], opts?: {
3239
3240
  tools?: TranscriptToolDetail;
3240
3241
  }): string | null;
3242
+ /** Brightsy server tool that compresses chat history (`context_summary` payload). */
3243
+ declare const BRIGHTSY_SUMMARIZE_CONTEXT_TOOL = "summarize_context";
3244
+ /**
3245
+ * Pull the summary text from a Brightsy `summarize_context` tool result.
3246
+ * Successful payloads are `{ context_summary: "..." }`; failures are skipped.
3247
+ */
3248
+ declare function extractBrightsyContextSummary(result: string | undefined): string | null;
3249
+ declare function findLastBrightsyContextSummary(messages: ThreadMessage[]): {
3250
+ index: number;
3251
+ text: string;
3252
+ } | null;
3253
+ /**
3254
+ * Messages Brightsy should see after its last successful `summarize_context`
3255
+ * tool (everything after that tool row). Matches Brightsy's own prompt
3256
+ * builder: drop history before the tool result, keep the tail. No last-N cap.
3257
+ * If the tool has never succeeded, return the full history.
3258
+ */
3259
+ declare function messagesSinceLastBrightsyContextSummary(messages: ThreadMessage[]): ThreadMessage[];
3260
+ /**
3261
+ * Brightsy `chat` is a stateless completion (one stdin blob, no --resume).
3262
+ * Seed the last `summarize_context` result plus every later turn, text-only
3263
+ * so other tool dumps do not empty-complete.
3264
+ */
3265
+ declare function buildBrightsySessionSeed(messages: ThreadMessage[]): string | null;
3241
3266
  declare function applyCompaction(messages: ThreadMessage[], summaryText: string, thresholds?: CompactThresholds): ThreadMessage[];
3242
3267
  interface CompactResult {
3243
3268
  didCompact: boolean;
@@ -5421,4 +5446,4 @@ declare function pollSlackOutboundWatches(opts?: {
5421
5446
  now?: number;
5422
5447
  }): Promise<void>;
5423
5448
 
5424
- export { ABLETIME_MCP_PATH, AGENT_GIT_ACTIONS, AGENT_RUNNER_MAX_OLD_SPACE_MB, ATTACHMENTS_DIR, type AbleTimeAssignedIssuesResult, type AbleTimeMcpToolName, type AbleTimeOrientation, type AbleTimeProject, type AbleTimeTask, type AbleTimeViewer, type ActiveRun, type AddBoardPinInput, 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, BUNDLED_LONG_RUNNING_PATH, BUNDLED_SKILL_PREFIX, type BoardPin, type BranchInfo, type BrightsyAccount, type BrightsyChatTarget, type BrightsyChatTargets, type BrightsyCloudConnectAgent, type BrightsyHarnessSettings, type BrightsySession, BrightsySideboardApi, type BrightsyTeamTargets, CHARS_PER_CONTEXT_TOKEN, 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, DEFAULT_ABLETIME_HOST, DEFAULT_WORKTREE_SORT, 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, HOME_BOARD_CACHE_TTL_MS, type HarnessId, type HomeBoardLoaded, type HomeBoardRemoteData, ISSUE_SOURCE_LABELS, type InitStackFromThreadInput, type IntegrationsSettings, type IpcApi, type IssueCycleInfo, 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, LONG_RUNNING_SKILL_COMMAND, type LandPreview, type LandResult, type LinearAssignedIssuesResult, type LinearComment, type LinearIssue, LinearOAuthCancelledError, type LinearTeam, type LinearTeamsResult, type LinearWorkflowState, type ListIssuesResult, MAX_ANTHROPIC_CACHE_CONTROL_BLOCKS, type McpServerStatus, type MessagePart, OPTIONAL_SERVICES, OPTIONAL_SERVICE_IDS, ORCHESTRATOR_AGENT_KINDS, type OpenPrStackLayersInput, type OpenStackLayerInput, type OpenStackLayerResult, type OptionalServiceCliStatus, type OptionalServiceId, type OptionalServiceSpec, 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, PLAN_QUESTION_ANSWERS_PREFIX, 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, type WorktreeSortMode, abletimeMcpRequest, abletimeMcpUrl, ackSlackInboundSeen, addBoardPin, addPrStackLayer, addStackLayerFromThread, addWorkspace, adoptThread, agentGitPrompt, allAdapters, allocatePort, allocatePortRange, allocateTeamName, allocateTeamSlug, appDataDir, appSettingsPath, appendIndexedGitConfig, appendMessage, applyAgentEvent, applyAgentRunnerHeapEnv, applyAppEnvironment, applyCompaction, applyForwardOccupancy, applyGithubGitAuthEnv, applyPromptCacheTtlEnv, applyThreadIntoMain, applyTurnUsage, armSchedules, assertOrchestratorCapableAgent, attachmentFromAbsolutePath, attachmentsFromBuffers, attachmentsFromWorktreePaths, attachmentsGitignoreBody, autoArchiveOnMergeEnabled, autoCleanupOrphansEnabled, autoRenameBranchEnabled, autoRunAfterSetupEnabled, branchDisplayLabel, brightsyAccessTokenNeedsRefresh, brightsyAdapter, brightsyCloudConnectAgent, brightsyCloudConnectEnabled, brightsyConfigPath, brightsyInjectWorktreeMcpEnabled, brightsyMcpAllowedTools, brightsyMcpServerName, buildCachedUserContent, buildClaudeStreamJsonUserMessage, buildDiffCommentAttachment, buildForkTranscriptAttachment, buildPastedTextAttachment, buildReviewRequestAttachment, buildSessionSeed, buildWorkspaceScriptEnv, caffeinateHoldPath, caffeinateWhileCloudConnectEnabled, caffeinateWhileRunningEnabled, caffeinateWhileSchedulesEnabled, caffeinateWhileSlackListenEnabled, callAbleTimeTool, canonicalizeRepoPath, captureLoginEnv, captureTurnBaseline, checkoutPrStackLayer, childEnvWithAppSettings, claimDesktopHost, classifyWorktreeColumn, claudeAdapter, claudeChromeEnabled, claudeUserSettingsPath, cleanupOrphanWorktrees, clearBoardPins, clearHomeBoardCache, cloneRepoIntoSideboard, codexAdapter, codexSandboxWritableRootsArgs, codexUnattendedGitConfigArgs, coerceOrchestratorAgent, collectTakenTeamSlugs, commentLinearIssue, commitAll, computeNextRunAt, conductorBundledBinDir, conductorDbPath, confirmLand, connectBrightsyTeam, connectOptionalService, connectSlackToken, connectedOptionalServices, contextTokens, coordinatorSystemPrompt, coordinatorTurnReminder, copyConfiguredFiles, countCacheControlBlocks, cowboyModeEnabled, createAbleTimeTask, createChatTab, createEmptyThread, createExistingBranchWorktree, createGlobalChat, createLinearIssue, createLinearPkce, createOrUpdatePr, createPrStack, createSchedule, createThread, createThreadWorktree, currentBranch, cursorAdapter, cursorSdkMessageToEvents, decodeBrightsyTarget, defaultScheduleName, deleteBranchOnPurgeEnabled, deleteSchedule, deleteThreadRecord, desktopHostPidPath, detectAgents, detectGhStack, detectLocalMergeConflicts, detectOptionalServiceClis, disconnectAbleTimeConnection, disconnectBrightsyTeam, disconnectLinear, disconnectLinearConnection, disconnectOptionalService, disconnectSlackWorkspace, discoverSkills, dropCachedPrefixOnResume, emptyPublicIntegrations, encodeBrightsyTarget, enrichPathWithNpmGlobalBin, enrichWorkspacesWithGithub, ensureAbleTimeTask, ensureAgentPath, ensureBrightsyLocalConfigFresh, ensureCloudCoordinator, ensureConnectedBrightsyTeamTokens, ensureGhPreferOrigin, ensureGlobalCoordinatorCwd, ensureReviewRequestFile, ensureReviewSkillFile, ensureSlackCoordinator, ensureSlackDeviceIdentity, ensureWorkspace, estimateMessageChars, estimateOccupancyTokens, estimateThreadChars, expandComposerPrompt, extractGhErrorDetail, extractPendingPlanQuestions, extractPresentedPlan, extractiveSummary, fetchPrHead, finalizeParts, findConventionSetup, findInvalidCacheControlTtlOrder, findLiveThreadForCreate, findOrphanWorktrees, findSlackCoordinator, findThreadByRef, findThreadForStackLayer, fireSchedule, flattenTurnInput, forkChatTab, forkMessageSlice, forkThreadWorktree, formatAgentInstructions, formatArtifactDirective, formatBrightsyFetchError, formatDetachedJobInvoke, formatFetchError, formatGhLandError, formatGitAuthModeDirective, formatIpcInvokeError, formatLongRunningDirective, formatLongRunningReminder, formatMergePrError, formatMessagesAsTranscript, formatOptionalServicesDirective, formatOptionalServicesReminder, formatPlanQuestionAnswers, formatPlanQuestionsForChat, formatProcessGuideDirective, formatRateLimitResetHint, formatRenameBranchDirective, formatScheduleWhen, formatScheduledPrompt, formatSlackExternalReplyPrompt, formatSlackInboundPrompt, formatSlackRepliesForTurn, formatSlackReplyContinuePrompt, formatSlackSignedReply, formatSlackWorkingText, formatTranscriptMarkdown, formatUiReminder, formatWorkspaceInventory, formatWorktreeDirective, formatWorktreeReminder, forwardContextUsage, forwardOccupancyTokens, fromInclusiveInputUsage, getAbleTimeAccessToken, getAbleTimeHost, getAbleTimeOrientation, getAbleTimeTask, getAdapter, getAgentSetupInfo, getBrightsySession, getCaffeinateHold, getDefaultAgent, getDefaultEffort, getDefaultFast, getDefaultModel, getDefaultRunScript, getDiff, getDiffSummary, getGitHubStatus, getGithubGitAuthMode, getGithubPat, getHomeBoardInputs, getIssueSource, getLinearApiKey, getLinearAuthToken, getLinearIssue, getOrchestrator, getPr, getPrChecks, getPrDetails, getPrForHeadBranch, getPrMeta, getPrStack, getRepoSetupInfo, getRunMode, getRunScript, getSchedule, getSlackWorkspace, gh, ghHeadRef, ghRepoSelectArgs, git, githubAgentGitEnv, globalAgentCwd, groupHomeBoardWorktrees, handleSlackInbound, harnessEnvKey, hasBakedLinearOAuth, hasBakedSlackOAuth, hasConductorHook, hasConventionSetup, hasCursorWorktreeSetup, hasEnabledSchedules, hasRepoHook, hasWorkspaceHook, healOrchestrationSoccerTitles, httpFetch, importConductorWorkspace, importConductorWorkspaceAsync, initPrStack, initStackFromThread, initializeGitRepository, inspectGitWorktree, installAgent, installNpmGlobalPackage, installOptionalServiceCli, interruptSlackCoordinatorForInbound, invalidateThreadListCache, isAbleTimeConnected, isAskUserToolName, isBrightsyConnected, isBrightsyNdjsonLine, isCloudCoordinatorThread, isConductorBundledCli, isCowboyThread, isCursorAutoModel, isDefaultishSourceRef, isDesktopHostAlive, isDirty, isGhRateLimitError, isGlobalRepoPath, isGlobalThread, isHomeBoardThread, isImageFilePath, isInPrStack, isInboundForThisDesktop, isIssueSourceConnected, isLinearConnected, isLinearOAuthCancelled, isOptionalServiceId, isOrchestratorCapableAgent, isOrchestratorThread, isPidAlive, isPlaceholderBranch, isPlanQuestionAnswersMessage, isPollWrapperToolName, isPrNotMergeableError, isPresentPlanToolName, isPrimaryCheckoutThread, isSessionQuotaLimit, isShellToolName, isSideboardScratchPath, isSlackCoordinatorThread, isSlackExternalReplyPrompt, isSlackOAuthCancelled, isSubagentToolName, isThinkingEffort, isThisProcessDesktopHost, isThreadCaffeinated, isThreadRecordFile, isWorkspaceScratchPath, issueAttachmentForAbleTimeTask, issueSourceLabel, lastRequestOccupancy, latestPendingPlanQuestions, linearAuthorizationHeader, linearCycleIsActive, linearGraphql, linearOAuthAuthorizeUrl, linearOAuthCredentials, listAbleTimeAssignedIssues, listAbleTimeProjects, listAbleTimeTasks, listAgentSetupInfo, listBoardPins, listBranchCommits, listBranches, listBrightsyAccounts, listBrightsyChatTargets, listCodexModels, listConductorWorkspaces, listConnectedBrightsyTeams, listCursorModels, listGitHubIssues, listGlobalThreads, listIssues, listLinearAssignedIssues, listLinearIssues, listLinearIssuesDirect, listLinearTeams, listModelsForAgent, listOpencodeModels, listPrs, listRunScripts, listSchedules, listSlackOutboundWatches, listSlackWorkspaces, listThreads, listWorkspaces, listWorktreeFiles, listWorktrees, liveActivitySummary, loadAgentInstructions, loadAppSettings, loadBrightsyConfig, loadConductorSettings, loadHomeBoardInputs, loadRepoSettings, loadWorkspaceSettings, locksDir, loginAgent, lookupSoccerTeam, mapAbleTimeTask, maxConcurrentAgents, maybeCompactContext, mcpAllowTools, mcpAuthWarnings, mergeAgentGitAuthEnv, mergePr, mergePrStack, mergeSideboardIntoMcpServersJson, mergeUsage, messagePartParentId, nextPastedTextName, nextThinkingEffort, nonInteractiveGitProcessEnv, normalizeAbleTimeHost, normalizeParseResult, normalizeServiceOrigin, normalizeThinkingEffort, normalizeThread, normalizeTurnInput, normalizeWorktreePath, openInSystemTerminal, openPrStackLayers, openStackLayer, opencodeAdapter, optionalServiceConnected, optionalServiceSpec, orchestrationQuotaFallbackAgent, orchestrationQuotaOnLimit, orchestrationTitleNeedsSoccerNickname, orchestratorSessionPoisonedByBuiltins, originGhRepoEnv, packagedDetachedJobPath, parseCursorRunnerLine, parseDurationMs, parseForceStopMessage, parseGhStackViewJson, parseGithubSlugFromRemoteUrl, parseMcpList, parsePlanQuestionsInput, parseSessionQuotaResetAt, parseSlackRelayClientMessage, parseSlackRelayServerMessage, partsToAssistantText, pastedTextStats, pendingSlackExternalReplies, permissionMode, persistPendingFileAttachments, persistVaultKeyInKeychain, planFileAbs, planQuestionsSignature, pollSlackOutboundWatches, posixShellSingleQuote, preferredCursorCostCents, prepareTerminalCommand, previewLand, promptMentionsBrightsy, pushBranch, readExistingReviewRequestFile, readKeychainVaultKey, readPlanFile, readSkillBody, readThread, readWorktreeFile, readWorktreeFileForUpload, readWorktreeInclude, recordScheduleRun, recordSlackOutboundWatch, refreshBrightsyAccessToken, refreshGitHubAuth, registerPackagedUserMcpClients, releaseCaffeinateHoldForThread, releaseDesktopHost, removeBoardPin, removeWorkspace, removeWorktree, repoSlug, requestOccupancy, requestReview, requireAgent, resetGhStackDetectCache, resetGithubAgentTokenMemo, resolveAgentExecutable, resolveAgentGitAuthEnv, resolveClaudeExecutable, resolveCodexGitWritableRoots, resolveCommandBinarySync, resolveConductorCursorAgentId, resolveCursorModelId, resolveDefaultBranch, resolveDetachedJobScript, resolveDiffBaseRef, resolveEffectiveIssueSource, resolveFilesToCopy, resolveGhAuthToken, resolveGitDirsForLockRecovery, resolveGithubAgentToken, resolveGithubRepoSlug, resolveLinearState, resolveLinearTeam, resolveLoginCommand, resolveNewThreadOptions, resolvePlanMarkdown, resolvePrSelector, resolvePrSelectors, resolveQuotaFallbackAgent, resolveRepoRoot, resolveReviewGuidelines, resolveScheduleThreadId, resolveSlackListenMode, resolveThreadDefaults, resolveThreadEffort, resolveVaultKey, resolveWorktreeStartPoint, rewriteAbleTimeError, rewriteLinearError, run, runArchiveScript, runCloudConnect, runConventionSetup, runCursorWorktreeSetup, runSetupScript, runSlackListen, runSlackRelayClient, runWorkspaceSetup, sameWorktreePath, sanitizeMcpServerName, saveAbleTimeConnection, saveAppSettings, saveLinearOAuth, schedulesPath, scrubGithubTokensFromChildEnv, searchAbleTimeTasks, 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, taskUrl, thinkingEffortBars, thinkingEffortLabel, thisProcessShouldDrainAgentQueues, threadDisplayLabel, threadFilePath, threadHasCompactedContext, threadLivePath, threadLockPath, threadRequestsBrightsyMcp, threadsDir, threadsSharingWorktree, toAbleTimeIssueInfo, toPublicAppSettings, toolActivityLine, toolDescription, toolDetail, toolFilePath, totalTokens, turnCostUsdFromCursorUsage, updateAdvancedSettings, updateAgentExecutable, updateAppEnvironment, updateBrightsySettings, updateClaudeSettings, updateCodexSettings, updateDefaultsSettings, updateIntegrationsSettings, updateLinearIssue, updateOpencodeSettings, updateSchedule, updateThread, userClaudeMcpConfigPath, userCursorMcpConfigPath, validateLinearApiKey, verifyAbleTimeConnection, verifyOptionalService, visibleToolRowDetail, waitForPidExit, warmGithubAgentAuth, whichOnPath, withAgentInstructions, withEventParentId, withEventsParentId, withExportedPath, withMaxOldSpaceSize, withThreadLock, workspaceSettingsSourceLabel, worktreeBoardStatus, worktreeCleanupSettings, worktreeDisplayLabel, worktreeDisplayLabelForGroup, worktreeNameFromPath, worktreesRoot, wrapReviewSkillMarkdown, writeInjectedMcpConfig, writePlanFile, writeThread, writeWorktreeFile };
5449
+ export { ABLETIME_MCP_PATH, AGENT_GIT_ACTIONS, AGENT_RUNNER_MAX_OLD_SPACE_MB, ATTACHMENTS_DIR, type AbleTimeAssignedIssuesResult, type AbleTimeMcpToolName, type AbleTimeOrientation, type AbleTimeProject, type AbleTimeTask, type AbleTimeViewer, type ActiveRun, type AddBoardPinInput, 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, BRIGHTSY_SUMMARIZE_CONTEXT_TOOL, BUNDLED_LONG_RUNNING_PATH, BUNDLED_SKILL_PREFIX, type BoardPin, type BranchInfo, type BrightsyAccount, type BrightsyChatTarget, type BrightsyChatTargets, type BrightsyCloudConnectAgent, type BrightsyHarnessSettings, type BrightsySession, BrightsySideboardApi, type BrightsyTeamTargets, CHARS_PER_CONTEXT_TOKEN, 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, DEFAULT_ABLETIME_HOST, DEFAULT_WORKTREE_SORT, 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, HOME_BOARD_CACHE_TTL_MS, type HarnessId, type HomeBoardLoaded, type HomeBoardRemoteData, ISSUE_SOURCE_LABELS, type InitStackFromThreadInput, type IntegrationsSettings, type IpcApi, type IssueCycleInfo, 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, LONG_RUNNING_SKILL_COMMAND, type LandPreview, type LandResult, type LinearAssignedIssuesResult, type LinearComment, type LinearIssue, LinearOAuthCancelledError, type LinearTeam, type LinearTeamsResult, type LinearWorkflowState, type ListIssuesResult, MAX_ANTHROPIC_CACHE_CONTROL_BLOCKS, type McpServerStatus, type MessagePart, OPTIONAL_SERVICES, OPTIONAL_SERVICE_IDS, ORCHESTRATOR_AGENT_KINDS, type OpenPrStackLayersInput, type OpenStackLayerInput, type OpenStackLayerResult, type OptionalServiceCliStatus, type OptionalServiceId, type OptionalServiceSpec, 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, PLAN_QUESTION_ANSWERS_PREFIX, 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, type WorktreeSortMode, abletimeMcpRequest, abletimeMcpUrl, ackSlackInboundSeen, addBoardPin, addPrStackLayer, addStackLayerFromThread, addWorkspace, adoptThread, agentGitPrompt, allAdapters, allocatePort, allocatePortRange, allocateTeamName, allocateTeamSlug, appDataDir, appSettingsPath, appendIndexedGitConfig, appendMessage, applyAgentEvent, applyAgentRunnerHeapEnv, applyAppEnvironment, applyCompaction, applyForwardOccupancy, applyGithubGitAuthEnv, applyPromptCacheTtlEnv, applyThreadIntoMain, applyTurnUsage, armSchedules, assertOrchestratorCapableAgent, attachmentFromAbsolutePath, attachmentsFromBuffers, attachmentsFromWorktreePaths, attachmentsGitignoreBody, autoArchiveOnMergeEnabled, autoCleanupOrphansEnabled, autoRenameBranchEnabled, autoRunAfterSetupEnabled, branchDisplayLabel, brightsyAccessTokenNeedsRefresh, brightsyAdapter, brightsyCloudConnectAgent, brightsyCloudConnectEnabled, brightsyConfigPath, brightsyInjectWorktreeMcpEnabled, brightsyMcpAllowedTools, brightsyMcpServerName, buildBrightsySessionSeed, buildCachedUserContent, buildClaudeStreamJsonUserMessage, buildDiffCommentAttachment, buildForkTranscriptAttachment, buildPastedTextAttachment, buildReviewRequestAttachment, buildSessionSeed, buildWorkspaceScriptEnv, caffeinateHoldPath, caffeinateWhileCloudConnectEnabled, caffeinateWhileRunningEnabled, caffeinateWhileSchedulesEnabled, caffeinateWhileSlackListenEnabled, callAbleTimeTool, canonicalizeRepoPath, captureLoginEnv, captureTurnBaseline, checkoutPrStackLayer, childEnvWithAppSettings, claimDesktopHost, classifyWorktreeColumn, claudeAdapter, claudeChromeEnabled, claudeUserSettingsPath, cleanupOrphanWorktrees, clearBoardPins, clearHomeBoardCache, cloneRepoIntoSideboard, codexAdapter, codexSandboxWritableRootsArgs, codexUnattendedGitConfigArgs, coerceOrchestratorAgent, collectTakenTeamSlugs, commentLinearIssue, commitAll, computeNextRunAt, conductorBundledBinDir, conductorDbPath, confirmLand, connectBrightsyTeam, connectOptionalService, connectSlackToken, connectedOptionalServices, contextTokens, coordinatorSystemPrompt, coordinatorTurnReminder, copyConfiguredFiles, countCacheControlBlocks, cowboyModeEnabled, createAbleTimeTask, createChatTab, createEmptyThread, createExistingBranchWorktree, createGlobalChat, createLinearIssue, createLinearPkce, createOrUpdatePr, createPrStack, createSchedule, createThread, createThreadWorktree, currentBranch, cursorAdapter, cursorSdkMessageToEvents, decodeBrightsyTarget, defaultScheduleName, deleteBranchOnPurgeEnabled, deleteSchedule, deleteThreadRecord, desktopHostPidPath, detectAgents, detectGhStack, detectLocalMergeConflicts, detectOptionalServiceClis, disconnectAbleTimeConnection, disconnectBrightsyTeam, disconnectLinear, disconnectLinearConnection, disconnectOptionalService, disconnectSlackWorkspace, discoverSkills, dropCachedPrefixOnResume, emptyPublicIntegrations, encodeBrightsyTarget, enrichPathWithNpmGlobalBin, enrichWorkspacesWithGithub, ensureAbleTimeTask, ensureAgentPath, ensureBrightsyLocalConfigFresh, ensureCloudCoordinator, ensureConnectedBrightsyTeamTokens, ensureGhPreferOrigin, ensureGlobalCoordinatorCwd, ensureReviewRequestFile, ensureReviewSkillFile, ensureSlackCoordinator, ensureSlackDeviceIdentity, ensureWorkspace, estimateMessageChars, estimateOccupancyTokens, estimateThreadChars, expandComposerPrompt, extractBrightsyContextSummary, extractGhErrorDetail, extractPendingPlanQuestions, extractPresentedPlan, extractiveSummary, fetchPrHead, finalizeParts, findConventionSetup, findInvalidCacheControlTtlOrder, findLastBrightsyContextSummary, findLiveThreadForCreate, findOrphanWorktrees, findSlackCoordinator, findThreadByRef, findThreadForStackLayer, fireSchedule, flattenTurnInput, forkChatTab, forkMessageSlice, forkThreadWorktree, formatAgentInstructions, formatArtifactDirective, formatBrightsyFetchError, formatDetachedJobInvoke, formatFetchError, formatGhLandError, formatGitAuthModeDirective, formatIpcInvokeError, formatLongRunningDirective, formatLongRunningReminder, formatMergePrError, formatMessagesAsTranscript, formatOptionalServicesDirective, formatOptionalServicesReminder, formatPlanQuestionAnswers, formatPlanQuestionsForChat, formatProcessGuideDirective, formatRateLimitResetHint, formatRenameBranchDirective, formatScheduleWhen, formatScheduledPrompt, formatSlackExternalReplyPrompt, formatSlackInboundPrompt, formatSlackRepliesForTurn, formatSlackReplyContinuePrompt, formatSlackSignedReply, formatSlackWorkingText, formatTranscriptMarkdown, formatUiReminder, formatWorkspaceInventory, formatWorktreeDirective, formatWorktreeReminder, forwardContextUsage, forwardOccupancyTokens, fromInclusiveInputUsage, getAbleTimeAccessToken, getAbleTimeHost, getAbleTimeOrientation, getAbleTimeTask, getAdapter, getAgentSetupInfo, getBrightsySession, getCaffeinateHold, getDefaultAgent, getDefaultEffort, getDefaultFast, getDefaultModel, getDefaultRunScript, getDiff, getDiffSummary, getGitHubStatus, getGithubGitAuthMode, getGithubPat, getHomeBoardInputs, getIssueSource, getLinearApiKey, getLinearAuthToken, getLinearIssue, getOrchestrator, getPr, getPrChecks, getPrDetails, getPrForHeadBranch, getPrMeta, getPrStack, getRepoSetupInfo, getRunMode, getRunScript, getSchedule, getSlackWorkspace, gh, ghHeadRef, ghRepoSelectArgs, git, githubAgentGitEnv, globalAgentCwd, groupHomeBoardWorktrees, handleSlackInbound, harnessEnvKey, hasBakedLinearOAuth, hasBakedSlackOAuth, hasConductorHook, hasConventionSetup, hasCursorWorktreeSetup, hasEnabledSchedules, hasRepoHook, hasWorkspaceHook, healOrchestrationSoccerTitles, httpFetch, importConductorWorkspace, importConductorWorkspaceAsync, initPrStack, initStackFromThread, initializeGitRepository, inspectGitWorktree, installAgent, installNpmGlobalPackage, installOptionalServiceCli, interruptSlackCoordinatorForInbound, invalidateThreadListCache, isAbleTimeConnected, isAskUserToolName, isBrightsyConnected, isBrightsyNdjsonLine, isCloudCoordinatorThread, isConductorBundledCli, isCowboyThread, isCursorAutoModel, isDefaultishSourceRef, isDesktopHostAlive, isDirty, isGhRateLimitError, isGlobalRepoPath, isGlobalThread, isHomeBoardThread, isImageFilePath, isInPrStack, isInboundForThisDesktop, isIssueSourceConnected, isLinearConnected, isLinearOAuthCancelled, isOptionalServiceId, isOrchestratorCapableAgent, isOrchestratorThread, isPidAlive, isPlaceholderBranch, isPlanQuestionAnswersMessage, isPollWrapperToolName, isPrNotMergeableError, isPresentPlanToolName, isPrimaryCheckoutThread, isSessionQuotaLimit, isShellToolName, isSideboardScratchPath, isSlackCoordinatorThread, isSlackExternalReplyPrompt, isSlackOAuthCancelled, isSubagentToolName, isThinkingEffort, isThisProcessDesktopHost, isThreadCaffeinated, isThreadRecordFile, isWorkspaceScratchPath, issueAttachmentForAbleTimeTask, issueSourceLabel, lastRequestOccupancy, latestPendingPlanQuestions, linearAuthorizationHeader, linearCycleIsActive, linearGraphql, linearOAuthAuthorizeUrl, linearOAuthCredentials, listAbleTimeAssignedIssues, listAbleTimeProjects, listAbleTimeTasks, listAgentSetupInfo, listBoardPins, listBranchCommits, listBranches, listBrightsyAccounts, listBrightsyChatTargets, listCodexModels, listConductorWorkspaces, listConnectedBrightsyTeams, listCursorModels, listGitHubIssues, listGlobalThreads, listIssues, listLinearAssignedIssues, listLinearIssues, listLinearIssuesDirect, listLinearTeams, listModelsForAgent, listOpencodeModels, listPrs, listRunScripts, listSchedules, listSlackOutboundWatches, listSlackWorkspaces, listThreads, listWorkspaces, listWorktreeFiles, listWorktrees, liveActivitySummary, loadAgentInstructions, loadAppSettings, loadBrightsyConfig, loadConductorSettings, loadHomeBoardInputs, loadRepoSettings, loadWorkspaceSettings, locksDir, loginAgent, lookupSoccerTeam, mapAbleTimeTask, maxConcurrentAgents, maybeCompactContext, mcpAllowTools, mcpAuthWarnings, mergeAgentGitAuthEnv, mergePr, mergePrStack, mergeSideboardIntoMcpServersJson, mergeUsage, messagePartParentId, messagesSinceLastBrightsyContextSummary, nextPastedTextName, nextThinkingEffort, nonInteractiveGitProcessEnv, normalizeAbleTimeHost, normalizeParseResult, normalizeServiceOrigin, normalizeThinkingEffort, normalizeThread, normalizeTurnInput, normalizeWorktreePath, openInSystemTerminal, openPrStackLayers, openStackLayer, opencodeAdapter, optionalServiceConnected, optionalServiceSpec, orchestrationQuotaFallbackAgent, orchestrationQuotaOnLimit, orchestrationTitleNeedsSoccerNickname, orchestratorSessionPoisonedByBuiltins, originGhRepoEnv, packagedDetachedJobPath, parseCursorRunnerLine, parseDurationMs, parseForceStopMessage, parseGhStackViewJson, parseGithubSlugFromRemoteUrl, parseMcpList, parsePlanQuestionsInput, parseSessionQuotaResetAt, parseSlackRelayClientMessage, parseSlackRelayServerMessage, partsToAssistantText, pastedTextStats, pendingSlackExternalReplies, permissionMode, persistPendingFileAttachments, persistVaultKeyInKeychain, planFileAbs, planQuestionsSignature, pollSlackOutboundWatches, posixShellSingleQuote, preferredCursorCostCents, prepareTerminalCommand, previewLand, promptMentionsBrightsy, pushBranch, readExistingReviewRequestFile, readKeychainVaultKey, readPlanFile, readSkillBody, readThread, readWorktreeFile, readWorktreeFileForUpload, readWorktreeInclude, recordScheduleRun, recordSlackOutboundWatch, refreshBrightsyAccessToken, refreshGitHubAuth, registerPackagedUserMcpClients, releaseCaffeinateHoldForThread, releaseDesktopHost, removeBoardPin, removeWorkspace, removeWorktree, repoSlug, requestOccupancy, requestReview, requireAgent, resetGhStackDetectCache, resetGithubAgentTokenMemo, resolveAgentExecutable, resolveAgentGitAuthEnv, resolveClaudeExecutable, resolveCodexGitWritableRoots, resolveCommandBinarySync, resolveConductorCursorAgentId, resolveCursorModelId, resolveDefaultBranch, resolveDetachedJobScript, resolveDiffBaseRef, resolveEffectiveIssueSource, resolveFilesToCopy, resolveGhAuthToken, resolveGitDirsForLockRecovery, resolveGithubAgentToken, resolveGithubRepoSlug, resolveLinearState, resolveLinearTeam, resolveLoginCommand, resolveNewThreadOptions, resolvePlanMarkdown, resolvePrSelector, resolvePrSelectors, resolveQuotaFallbackAgent, resolveRepoRoot, resolveReviewGuidelines, resolveScheduleThreadId, resolveSlackListenMode, resolveThreadDefaults, resolveThreadEffort, resolveVaultKey, resolveWorktreeStartPoint, rewriteAbleTimeError, rewriteLinearError, run, runArchiveScript, runCloudConnect, runConventionSetup, runCursorWorktreeSetup, runSetupScript, runSlackListen, runSlackRelayClient, runWorkspaceSetup, sameWorktreePath, sanitizeMcpServerName, saveAbleTimeConnection, saveAppSettings, saveLinearOAuth, schedulesPath, scrubGithubTokensFromChildEnv, searchAbleTimeTasks, 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, taskUrl, thinkingEffortBars, thinkingEffortLabel, thisProcessShouldDrainAgentQueues, threadDisplayLabel, threadFilePath, threadHasCompactedContext, threadLivePath, threadLockPath, threadRequestsBrightsyMcp, threadsDir, threadsSharingWorktree, toAbleTimeIssueInfo, toPublicAppSettings, toolActivityLine, toolDescription, toolDetail, toolFilePath, totalTokens, turnCostUsdFromCursorUsage, updateAdvancedSettings, updateAgentExecutable, updateAppEnvironment, updateBrightsySettings, updateClaudeSettings, updateCodexSettings, updateDefaultsSettings, updateIntegrationsSettings, updateLinearIssue, updateOpencodeSettings, updateSchedule, updateThread, userClaudeMcpConfigPath, userCursorMcpConfigPath, validateLinearApiKey, verifyAbleTimeConnection, verifyOptionalService, visibleToolRowDetail, waitForPidExit, warmGithubAgentAuth, whichOnPath, withAgentInstructions, withEventParentId, withEventsParentId, withExportedPath, withMaxOldSpaceSize, withThreadLock, workspaceSettingsSourceLabel, worktreeBoardStatus, worktreeCleanupSettings, worktreeDisplayLabel, worktreeDisplayLabelForGroup, worktreeNameFromPath, worktreesRoot, wrapReviewSkillMarkdown, writeInjectedMcpConfig, writePlanFile, writeThread, writeWorktreeFile };
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  AGENT_GIT_ACTIONS,
3
3
  BOARD_COLUMN_DEFS,
4
+ BRIGHTSY_SUMMARIZE_CONTEXT_TOOL,
4
5
  BUNDLED_LONG_RUNNING_PATH,
5
6
  BUNDLED_SKILL_PREFIX,
6
7
  CHARS_PER_CONTEXT_TOKEN,
@@ -38,6 +39,7 @@ import {
38
39
  armSchedules,
39
40
  assembleHomeBoard,
40
41
  boardPinIdentity,
42
+ buildBrightsySessionSeed,
41
43
  buildForkTranscriptAttachment,
42
44
  buildReviewRequestAttachment,
43
45
  buildSessionSeed,
@@ -74,10 +76,12 @@ import {
74
76
  estimateOccupancyTokens,
75
77
  estimateThreadChars,
76
78
  expandComposerPrompt,
79
+ extractBrightsyContextSummary,
77
80
  extractiveSummary,
78
81
  findBoardIssue,
79
82
  findBoardPin,
80
83
  findBoardPr,
84
+ findLastBrightsyContextSummary,
81
85
  findLiveThreadForCreate,
82
86
  findOrphanWorktrees,
83
87
  findThreadForStackLayer,
@@ -144,6 +148,7 @@ import {
144
148
  listWorktreeFiles,
145
149
  loadAgentInstructions,
146
150
  maybeCompactContext,
151
+ messagesSinceLastBrightsyContextSummary,
147
152
  normalizeServiceOrigin,
148
153
  openPrStackLayers,
149
154
  openStackLayer,
@@ -207,7 +212,7 @@ import {
207
212
  worktreeCleanupSettings,
208
213
  wrapReviewSkillMarkdown,
209
214
  writeWorktreeFile
210
- } from "./chunk-FGOD5MQ4.js";
215
+ } from "./chunk-FGT26PJE.js";
211
216
  import {
212
217
  BRIGHTSY_MCP_ALLOWED_TOOLS,
213
218
  CLAUDE_MODEL_CATALOG,
@@ -6395,6 +6400,7 @@ export {
6395
6400
  ATTACHMENTS_DIR,
6396
6401
  BAKED_SLACK_RELAY_URL,
6397
6402
  BRIGHTSY_MCP_ALLOWED_TOOLS,
6403
+ BRIGHTSY_SUMMARIZE_CONTEXT_TOOL,
6398
6404
  BUNDLED_LONG_RUNNING_PATH,
6399
6405
  BUNDLED_SKILL_PREFIX,
6400
6406
  BrightsySideboardApi,
@@ -6508,6 +6514,7 @@ export {
6508
6514
  brightsyInjectWorktreeMcpEnabled,
6509
6515
  brightsyMcpAllowedTools,
6510
6516
  brightsyMcpServerName,
6517
+ buildBrightsySessionSeed,
6511
6518
  buildCachedUserContent,
6512
6519
  buildClaudeStreamJsonUserMessage,
6513
6520
  buildDiffCommentAttachment,
@@ -6610,6 +6617,7 @@ export {
6610
6617
  estimateOccupancyTokens,
6611
6618
  estimateThreadChars,
6612
6619
  expandComposerPrompt,
6620
+ extractBrightsyContextSummary,
6613
6621
  extractGhErrorDetail,
6614
6622
  extractPendingPlanQuestions,
6615
6623
  extractPresentedPlan,
@@ -6618,6 +6626,7 @@ export {
6618
6626
  finalizeParts,
6619
6627
  findConventionSetup,
6620
6628
  findInvalidCacheControlTtlOrder,
6629
+ findLastBrightsyContextSummary,
6621
6630
  findLiveThreadForCreate,
6622
6631
  findOrphanWorktrees,
6623
6632
  findSlackCoordinator,
@@ -6833,6 +6842,7 @@ export {
6833
6842
  mergeSideboardIntoMcpServersJson,
6834
6843
  mergeUsage,
6835
6844
  messagePartParentId,
6845
+ messagesSinceLastBrightsyContextSummary,
6836
6846
  nextPastedTextName,
6837
6847
  nextThinkingEffort,
6838
6848
  nonInteractiveGitProcessEnv,
@@ -11507,6 +11507,65 @@ function buildSessionSeed(messages, opts) {
11507
11507
  "Continue from this context. Do not repeat the summary unless asked."
11508
11508
  ].join("\n");
11509
11509
  }
11510
+ function extractBrightsyContextSummary(result) {
11511
+ if (!result?.trim()) return null;
11512
+ const trimmed = result.trim();
11513
+ const lower = trimmed.toLowerCase();
11514
+ if (lower.startsWith("context summarization failed") || lower.startsWith("nothing to summarize") || lower.startsWith("no messages found") || lower.startsWith("messages are required") || lower.startsWith("agent id is required")) {
11515
+ return null;
11516
+ }
11517
+ try {
11518
+ const parsed = JSON.parse(trimmed);
11519
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
11520
+ if (parsed.error != null && typeof parsed.context_summary !== "string") {
11521
+ return null;
11522
+ }
11523
+ if (typeof parsed.context_summary === "string" && parsed.context_summary.trim()) {
11524
+ return parsed.context_summary.trim();
11525
+ }
11526
+ return null;
11527
+ }
11528
+ } catch {
11529
+ }
11530
+ if (trimmed.includes('"error"') && !trimmed.includes("context_summary")) {
11531
+ return null;
11532
+ }
11533
+ return trimmed;
11534
+ }
11535
+ function findLastBrightsyContextSummary(messages) {
11536
+ for (let i = messages.length - 1; i >= 0; i--) {
11537
+ const message = messages[i];
11538
+ if (message?.role !== "agent") continue;
11539
+ for (const part of message.parts ?? []) {
11540
+ if (part.type !== "tool" || part.name !== BRIGHTSY_SUMMARIZE_CONTEXT_TOOL) {
11541
+ continue;
11542
+ }
11543
+ if (part.status === "error") continue;
11544
+ const text5 = extractBrightsyContextSummary(part.result);
11545
+ if (text5) return { index: i, text: text5 };
11546
+ }
11547
+ }
11548
+ return null;
11549
+ }
11550
+ function buildBrightsySessionSeed(messages) {
11551
+ const match = findLastBrightsyContextSummary(messages);
11552
+ const tail = match ? messages.slice(match.index + 1) : messages;
11553
+ const body = formatMessagesAsTranscript(tail, { tools: "none" });
11554
+ if (!match && !body.trim()) return null;
11555
+ const blocks = [
11556
+ "Sideboard conversation context (restored after compaction or a new session):",
11557
+ ""
11558
+ ];
11559
+ if (match) {
11560
+ blocks.push(`## Prior summary
11561
+ ${match.text}`, "");
11562
+ }
11563
+ if (body.trim()) {
11564
+ blocks.push(body, "");
11565
+ }
11566
+ blocks.push("Continue from this context. Do not repeat the summary unless asked.");
11567
+ return blocks.join("\n");
11568
+ }
11510
11569
  function applyCompaction(messages, summaryText, thresholds = {}) {
11511
11570
  const { older, recent } = splitForCompaction(messages, thresholds);
11512
11571
  if (older.length === 0) return messages;
@@ -11558,7 +11617,7 @@ async function maybeCompactContext(thread, thresholds = {}, summarize = summariz
11558
11617
  olderCount: older.length
11559
11618
  };
11560
11619
  }
11561
- var CONTEXT_COMPACT_CHARS, CONTEXT_KEEP_RECENT_CHARS, CONTEXT_KEEP_RECENT_MESSAGES, CONTEXT_MIN_MESSAGES, SESSION_RESET_OCCUPANCY_TOKENS;
11620
+ var CONTEXT_COMPACT_CHARS, CONTEXT_KEEP_RECENT_CHARS, CONTEXT_KEEP_RECENT_MESSAGES, CONTEXT_MIN_MESSAGES, SESSION_RESET_OCCUPANCY_TOKENS, BRIGHTSY_SUMMARIZE_CONTEXT_TOOL;
11562
11621
  var init_context_compact = __esm({
11563
11622
  "src/composer/context-compact.ts"() {
11564
11623
  "use strict";
@@ -11571,6 +11630,7 @@ var init_context_compact = __esm({
11571
11630
  CONTEXT_KEEP_RECENT_MESSAGES = 12;
11572
11631
  CONTEXT_MIN_MESSAGES = 10;
11573
11632
  SESSION_RESET_OCCUPANCY_TOKENS = 75e4;
11633
+ BRIGHTSY_SUMMARIZE_CONTEXT_TOOL = "summarize_context";
11574
11634
  }
11575
11635
  });
11576
11636
 
@@ -14100,6 +14160,21 @@ var init_reconcile_heal = __esm({
14100
14160
  }
14101
14161
  });
14102
14162
 
14163
+ // src/orchestrator/setup-last-error.ts
14164
+ function shouldStampSetupLastError(opts) {
14165
+ if (opts.turnInFlight) return false;
14166
+ if (opts.status === "running") return false;
14167
+ return true;
14168
+ }
14169
+ function isStaleLastErrorDuringTurn(err) {
14170
+ return Boolean(err?.trim());
14171
+ }
14172
+ var init_setup_last_error = __esm({
14173
+ "src/orchestrator/setup-last-error.ts"() {
14174
+ "use strict";
14175
+ }
14176
+ });
14177
+
14103
14178
  // src/threads/fork-worktree.ts
14104
14179
  function requireThread2(idOrRef) {
14105
14180
  const thread = findThreadByRef(idOrRef) ?? null;
@@ -17296,6 +17371,7 @@ var init_orchestrator = __esm({
17296
17371
  init_repo_git_lock();
17297
17372
  init_turn_live();
17298
17373
  init_reconcile_heal();
17374
+ init_setup_last_error();
17299
17375
  init_request_review();
17300
17376
  init_fork_worktree();
17301
17377
  init_quota_failover();
@@ -17674,6 +17750,13 @@ var init_orchestrator = __esm({
17674
17750
  const message = err instanceof Error ? err.message : String(err);
17675
17751
  if (/no setup script/i.test(message)) return;
17676
17752
  if (/already running/i.test(message)) return;
17753
+ const live = readThread(threadId);
17754
+ if (!shouldStampSetupLastError({
17755
+ turnInFlight: this.activeTurns.has(threadId) || this.startingTurns.has(threadId),
17756
+ status: live?.status
17757
+ })) {
17758
+ return;
17759
+ }
17677
17760
  updateThread(threadId, {
17678
17761
  lastError: `Setup failed: ${message}`
17679
17762
  });
@@ -17970,7 +18053,7 @@ var init_orchestrator = __esm({
17970
18053
  let seed = null;
17971
18054
  if (!fresh.sessionId) {
17972
18055
  const prior = fresh.messages.slice(0, -1);
17973
- seed = isBrightsy ? buildSessionSeed(prior.slice(-6), { tools: "none" }) : buildSessionSeed(prior);
18056
+ seed = isBrightsy ? buildBrightsySessionSeed(prior) : buildSessionSeed(prior);
17974
18057
  }
17975
18058
  let coordinatorDirective = null;
17976
18059
  if (isOrchestration) {
@@ -18020,7 +18103,7 @@ var init_orchestrator = __esm({
18020
18103
  )) {
18021
18104
  this.lastReconcileHealAt.set(threadId, now);
18022
18105
  const live = readThread(threadId);
18023
- if (live?.lastError?.includes("reconciled on startup") && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
18106
+ if (isStaleLastErrorDuringTurn(live?.lastError) && (this.activeTurns.has(threadId) || this.startingTurns.has(threadId))) {
18024
18107
  setStatus(threadId, "running");
18025
18108
  this.emit({ type: "status_changed", threadId, status: "running" });
18026
18109
  }
@@ -18097,7 +18180,7 @@ var init_orchestrator = __esm({
18097
18180
  });
18098
18181
  const retryThread = this.requireThread(threadId);
18099
18182
  const prior = retryThread.messages.slice(0, -1);
18100
- const retrySeed = buildSessionSeed(prior);
18183
+ const retrySeed = isBrightsy ? buildBrightsySessionSeed(prior) : buildSessionSeed(prior);
18101
18184
  const retryPrefix = [
18102
18185
  coordinatorDirective,
18103
18186
  worktreeDirective,
@@ -18477,9 +18560,15 @@ var init_orchestrator = __esm({
18477
18560
  );
18478
18561
  }
18479
18562
  if (setup.exitCode !== 0 && setup.exitCode !== null) {
18480
- updateThread(thread.id, {
18481
- lastError: `Setup exited ${setup.exitCode}`
18482
- });
18563
+ const live = readThread(thread.id);
18564
+ if (shouldStampSetupLastError({
18565
+ turnInFlight: this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id),
18566
+ status: live?.status
18567
+ })) {
18568
+ updateThread(thread.id, {
18569
+ lastError: `Setup exited ${setup.exitCode}`
18570
+ });
18571
+ }
18483
18572
  }
18484
18573
  this.emit({ type: "setup_finished", threadId: thread.id, exitCode: setup.exitCode });
18485
18574
  return { exitCode: setup.exitCode, source: setup.source };
@@ -32,7 +32,7 @@ import {
32
32
  slackTokenFor,
33
33
  syncBoardPins,
34
34
  updateSchedule
35
- } from "../chunk-JUWVAMRS.js";
35
+ } from "../chunk-OLR4UPP7.js";
36
36
  import {
37
37
  listModelsForAgent,
38
38
  sideboardMcpProfile
@@ -4,7 +4,7 @@ import {
4
4
  isPidAlive,
5
5
  startOrchestration,
6
6
  waitForPidExit
7
- } from "./chunk-FGOD5MQ4.js";
7
+ } from "./chunk-FGT26PJE.js";
8
8
  import "./chunk-VHTIHOHE.js";
9
9
  import "./chunk-KBWND62T.js";
10
10
  import "./chunk-M267JPEA.js";
@@ -6,7 +6,7 @@ import {
6
6
  isPidAlive,
7
7
  startOrchestration,
8
8
  waitForPidExit
9
- } from "./chunk-JUWVAMRS.js";
9
+ } from "./chunk-OLR4UPP7.js";
10
10
  import "./chunk-CG25RYQQ.js";
11
11
  import "./chunk-ED4UPEJX.js";
12
12
  import "./chunk-S42XV45P.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sideboard-ai/core",
3
- "version": "0.1.142",
3
+ "version": "0.1.144",
4
4
  "description": "Sideboard core — orchestration, agents, git worktrees, MCP server",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",