@sideboard-ai/core 0.1.142 → 0.1.143

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.
@@ -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-TDJZKQPT.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;
@@ -5536,7 +5596,7 @@ function formatScheduledPrompt(name, prompt) {
5536
5596
  ${prompt}`;
5537
5597
  }
5538
5598
  async function defaultDeps() {
5539
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-4BEZJ2BU.js");
5599
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-TDJZKQPT.js");
5540
5600
  const orch = getOrchestrator2();
5541
5601
  return {
5542
5602
  findThread: (id) => findThreadByRef(id),
@@ -6313,7 +6373,7 @@ var Orchestrator = class {
6313
6373
  let seed = null;
6314
6374
  if (!fresh.sessionId) {
6315
6375
  const prior = fresh.messages.slice(0, -1);
6316
- seed = isBrightsy ? buildSessionSeed(prior.slice(-6), { tools: "none" }) : buildSessionSeed(prior);
6376
+ seed = isBrightsy ? buildBrightsySessionSeed(prior) : buildSessionSeed(prior);
6317
6377
  }
6318
6378
  let coordinatorDirective = null;
6319
6379
  if (isOrchestration) {
@@ -6440,7 +6500,7 @@ var Orchestrator = class {
6440
6500
  });
6441
6501
  const retryThread = this.requireThread(threadId);
6442
6502
  const prior = retryThread.messages.slice(0, -1);
6443
- const retrySeed = buildSessionSeed(prior);
6503
+ const retrySeed = isBrightsy ? buildBrightsySessionSeed(prior) : buildSessionSeed(prior);
6444
6504
  const retryPrefix = [
6445
6505
  coordinatorDirective,
6446
6506
  worktreeDirective,
@@ -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-VIFXOHF4.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;
@@ -5848,7 +5913,7 @@ function formatScheduledPrompt(name, prompt) {
5848
5913
  ${prompt}`;
5849
5914
  }
5850
5915
  async function defaultDeps() {
5851
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-I2T44CRP.js");
5916
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-VIFXOHF4.js");
5852
5917
  const orch = getOrchestrator2();
5853
5918
  return {
5854
5919
  findThread: (id) => findThreadByRef(id),
@@ -6625,7 +6690,7 @@ var Orchestrator = class {
6625
6690
  let seed = null;
6626
6691
  if (!fresh.sessionId) {
6627
6692
  const prior = fresh.messages.slice(0, -1);
6628
- seed = isBrightsy ? buildSessionSeed(prior.slice(-6), { tools: "none" }) : buildSessionSeed(prior);
6693
+ seed = isBrightsy ? buildBrightsySessionSeed(prior) : buildSessionSeed(prior);
6629
6694
  }
6630
6695
  let coordinatorDirective = null;
6631
6696
  if (isOrchestration) {
@@ -6752,7 +6817,7 @@ var Orchestrator = class {
6752
6817
  });
6753
6818
  const retryThread = this.requireThread(threadId);
6754
6819
  const prior = retryThread.messages.slice(0, -1);
6755
- const retrySeed = buildSessionSeed(prior);
6820
+ const retrySeed = isBrightsy ? buildBrightsySessionSeed(prior) : buildSessionSeed(prior);
6756
6821
  const retryPrefix = [
6757
6822
  coordinatorDirective,
6758
6823
  worktreeDirective,
@@ -7992,6 +8057,11 @@ export {
7992
8057
  splitForCompaction,
7993
8058
  formatMessagesAsTranscript,
7994
8059
  buildSessionSeed,
8060
+ BRIGHTSY_SUMMARIZE_CONTEXT_TOOL,
8061
+ extractBrightsyContextSummary,
8062
+ findLastBrightsyContextSummary,
8063
+ messagesSinceLastBrightsyContextSummary,
8064
+ buildBrightsySessionSeed,
7995
8065
  applyCompaction,
7996
8066
  lastRequestOccupancy,
7997
8067
  shouldResetSessionForOccupancy,
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
 
@@ -18694,7 +18759,7 @@ var init_orchestrator = __esm({
18694
18759
  let seed = null;
18695
18760
  if (!fresh.sessionId) {
18696
18761
  const prior = fresh.messages.slice(0, -1);
18697
- seed = isBrightsy ? buildSessionSeed(prior.slice(-6), { tools: "none" }) : buildSessionSeed(prior);
18762
+ seed = isBrightsy ? buildBrightsySessionSeed(prior) : buildSessionSeed(prior);
18698
18763
  }
18699
18764
  let coordinatorDirective = null;
18700
18765
  if (isOrchestration) {
@@ -18821,7 +18886,7 @@ var init_orchestrator = __esm({
18821
18886
  });
18822
18887
  const retryThread = this.requireThread(threadId);
18823
18888
  const prior = retryThread.messages.slice(0, -1);
18824
- const retrySeed = buildSessionSeed(prior);
18889
+ const retrySeed = isBrightsy ? buildBrightsySessionSeed(prior) : buildSessionSeed(prior);
18825
18890
  const retryPrefix = [
18826
18891
  coordinatorDirective,
18827
18892
  worktreeDirective,
@@ -20069,6 +20134,7 @@ __export(index_exports, {
20069
20134
  ATTACHMENTS_DIR: () => ATTACHMENTS_DIR,
20070
20135
  BAKED_SLACK_RELAY_URL: () => BAKED_SLACK_RELAY_URL,
20071
20136
  BRIGHTSY_MCP_ALLOWED_TOOLS: () => BRIGHTSY_MCP_ALLOWED_TOOLS,
20137
+ BRIGHTSY_SUMMARIZE_CONTEXT_TOOL: () => BRIGHTSY_SUMMARIZE_CONTEXT_TOOL,
20072
20138
  BUNDLED_LONG_RUNNING_PATH: () => BUNDLED_LONG_RUNNING_PATH,
20073
20139
  BUNDLED_SKILL_PREFIX: () => BUNDLED_SKILL_PREFIX,
20074
20140
  BrightsySideboardApi: () => BrightsySideboardApi,
@@ -20182,6 +20248,7 @@ __export(index_exports, {
20182
20248
  brightsyInjectWorktreeMcpEnabled: () => brightsyInjectWorktreeMcpEnabled,
20183
20249
  brightsyMcpAllowedTools: () => brightsyMcpAllowedTools,
20184
20250
  brightsyMcpServerName: () => brightsyMcpServerName,
20251
+ buildBrightsySessionSeed: () => buildBrightsySessionSeed,
20185
20252
  buildCachedUserContent: () => buildCachedUserContent,
20186
20253
  buildClaudeStreamJsonUserMessage: () => buildClaudeStreamJsonUserMessage,
20187
20254
  buildDiffCommentAttachment: () => buildDiffCommentAttachment,
@@ -20284,6 +20351,7 @@ __export(index_exports, {
20284
20351
  estimateOccupancyTokens: () => estimateOccupancyTokens,
20285
20352
  estimateThreadChars: () => estimateThreadChars,
20286
20353
  expandComposerPrompt: () => expandComposerPrompt,
20354
+ extractBrightsyContextSummary: () => extractBrightsyContextSummary,
20287
20355
  extractGhErrorDetail: () => extractGhErrorDetail,
20288
20356
  extractPendingPlanQuestions: () => extractPendingPlanQuestions,
20289
20357
  extractPresentedPlan: () => extractPresentedPlan,
@@ -20292,6 +20360,7 @@ __export(index_exports, {
20292
20360
  finalizeParts: () => finalizeParts,
20293
20361
  findConventionSetup: () => findConventionSetup,
20294
20362
  findInvalidCacheControlTtlOrder: () => findInvalidCacheControlTtlOrder,
20363
+ findLastBrightsyContextSummary: () => findLastBrightsyContextSummary,
20295
20364
  findLiveThreadForCreate: () => findLiveThreadForCreate,
20296
20365
  findOrphanWorktrees: () => findOrphanWorktrees,
20297
20366
  findSlackCoordinator: () => findSlackCoordinator,
@@ -20507,6 +20576,7 @@ __export(index_exports, {
20507
20576
  mergeSideboardIntoMcpServersJson: () => mergeSideboardIntoMcpServersJson,
20508
20577
  mergeUsage: () => mergeUsage,
20509
20578
  messagePartParentId: () => messagePartParentId,
20579
+ messagesSinceLastBrightsyContextSummary: () => messagesSinceLastBrightsyContextSummary,
20510
20580
  nextPastedTextName: () => nextPastedTextName,
20511
20581
  nextThinkingEffort: () => nextThinkingEffort,
20512
20582
  nonInteractiveGitProcessEnv: () => nonInteractiveGitProcessEnv,
@@ -26650,6 +26720,7 @@ init_outbound_watch();
26650
26720
  ATTACHMENTS_DIR,
26651
26721
  BAKED_SLACK_RELAY_URL,
26652
26722
  BRIGHTSY_MCP_ALLOWED_TOOLS,
26723
+ BRIGHTSY_SUMMARIZE_CONTEXT_TOOL,
26653
26724
  BUNDLED_LONG_RUNNING_PATH,
26654
26725
  BUNDLED_SKILL_PREFIX,
26655
26726
  BrightsySideboardApi,
@@ -26763,6 +26834,7 @@ init_outbound_watch();
26763
26834
  brightsyInjectWorktreeMcpEnabled,
26764
26835
  brightsyMcpAllowedTools,
26765
26836
  brightsyMcpServerName,
26837
+ buildBrightsySessionSeed,
26766
26838
  buildCachedUserContent,
26767
26839
  buildClaudeStreamJsonUserMessage,
26768
26840
  buildDiffCommentAttachment,
@@ -26865,6 +26937,7 @@ init_outbound_watch();
26865
26937
  estimateOccupancyTokens,
26866
26938
  estimateThreadChars,
26867
26939
  expandComposerPrompt,
26940
+ extractBrightsyContextSummary,
26868
26941
  extractGhErrorDetail,
26869
26942
  extractPendingPlanQuestions,
26870
26943
  extractPresentedPlan,
@@ -26873,6 +26946,7 @@ init_outbound_watch();
26873
26946
  finalizeParts,
26874
26947
  findConventionSetup,
26875
26948
  findInvalidCacheControlTtlOrder,
26949
+ findLastBrightsyContextSummary,
26876
26950
  findLiveThreadForCreate,
26877
26951
  findOrphanWorktrees,
26878
26952
  findSlackCoordinator,
@@ -27088,6 +27162,7 @@ init_outbound_watch();
27088
27162
  mergeSideboardIntoMcpServersJson,
27089
27163
  mergeUsage,
27090
27164
  messagePartParentId,
27165
+ messagesSinceLastBrightsyContextSummary,
27091
27166
  nextPastedTextName,
27092
27167
  nextThinkingEffort,
27093
27168
  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-KP4OJUPH.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
 
@@ -17970,7 +18030,7 @@ var init_orchestrator = __esm({
17970
18030
  let seed = null;
17971
18031
  if (!fresh.sessionId) {
17972
18032
  const prior = fresh.messages.slice(0, -1);
17973
- seed = isBrightsy ? buildSessionSeed(prior.slice(-6), { tools: "none" }) : buildSessionSeed(prior);
18033
+ seed = isBrightsy ? buildBrightsySessionSeed(prior) : buildSessionSeed(prior);
17974
18034
  }
17975
18035
  let coordinatorDirective = null;
17976
18036
  if (isOrchestration) {
@@ -18097,7 +18157,7 @@ var init_orchestrator = __esm({
18097
18157
  });
18098
18158
  const retryThread = this.requireThread(threadId);
18099
18159
  const prior = retryThread.messages.slice(0, -1);
18100
- const retrySeed = buildSessionSeed(prior);
18160
+ const retrySeed = isBrightsy ? buildBrightsySessionSeed(prior) : buildSessionSeed(prior);
18101
18161
  const retryPrefix = [
18102
18162
  coordinatorDirective,
18103
18163
  worktreeDirective,
@@ -32,7 +32,7 @@ import {
32
32
  slackTokenFor,
33
33
  syncBoardPins,
34
34
  updateSchedule
35
- } from "../chunk-JUWVAMRS.js";
35
+ } from "../chunk-EAP4SMR3.js";
36
36
  import {
37
37
  listModelsForAgent,
38
38
  sideboardMcpProfile
@@ -6,7 +6,7 @@ import {
6
6
  isPidAlive,
7
7
  startOrchestration,
8
8
  waitForPidExit
9
- } from "./chunk-JUWVAMRS.js";
9
+ } from "./chunk-EAP4SMR3.js";
10
10
  import "./chunk-CG25RYQQ.js";
11
11
  import "./chunk-ED4UPEJX.js";
12
12
  import "./chunk-S42XV45P.js";
@@ -4,7 +4,7 @@ import {
4
4
  isPidAlive,
5
5
  startOrchestration,
6
6
  waitForPidExit
7
- } from "./chunk-FGOD5MQ4.js";
7
+ } from "./chunk-KP4OJUPH.js";
8
8
  import "./chunk-VHTIHOHE.js";
9
9
  import "./chunk-KBWND62T.js";
10
10
  import "./chunk-M267JPEA.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.143",
4
4
  "description": "Sideboard core — orchestration, agents, git worktrees, MCP server",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",