@sideboard-ai/core 0.1.200 → 0.1.202

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.
Files changed (31) hide show
  1. package/dist/{agents-N7WXOGN6.js → agents-573ZDIX6.js} +4 -4
  2. package/dist/{agents-ZRIFDXCB.js → agents-OXX3ONVY.js} +4 -4
  3. package/dist/{chunk-62IMZIIZ.js → chunk-27GGXX27.js} +38 -21
  4. package/dist/{chunk-EWDE54OI.js → chunk-54RSAMBH.js} +2 -2
  5. package/dist/{chunk-O2DRYD2B.js → chunk-7NKY2OX7.js} +91 -42
  6. package/dist/{chunk-PKUPOVKP.js → chunk-A2TAKYSG.js} +26 -26
  7. package/dist/{chunk-KJBYIIJU.js → chunk-DFUES6QU.js} +5 -0
  8. package/dist/{chunk-CJFBSQIB.js → chunk-INNLWYXW.js} +5 -0
  9. package/dist/{chunk-PDMNYCPL.js → chunk-LJHC62LZ.js} +2 -2
  10. package/dist/{chunk-5XSDGJMP.js → chunk-NIVF5NDN.js} +4 -4
  11. package/dist/{chunk-NXM45OS3.js → chunk-RPX6VDW7.js} +1 -1
  12. package/dist/{chunk-OSPE25A7.js → chunk-STPZQR5B.js} +1 -1
  13. package/dist/{coordinator-prompt-AL62H73U.js → coordinator-prompt-BH4EHFOO.js} +3 -3
  14. package/dist/{coordinator-prompt-2RWBH6W7.js → coordinator-prompt-TY5FHAXC.js} +3 -3
  15. package/dist/{global-workspace-Y5KKGXN7.js → global-workspace-5AZEEQRU.js} +3 -3
  16. package/dist/{global-workspace-VAO3BQP5.js → global-workspace-NLLAPQJI.js} +3 -3
  17. package/dist/index.cjs +13388 -13258
  18. package/dist/index.d.cts +13 -1
  19. package/dist/index.d.ts +13 -1
  20. package/dist/index.js +79 -5
  21. package/dist/mcp/run-stdio.cjs +31 -9
  22. package/dist/mcp/run-stdio.js +5 -5
  23. package/dist/{orchestrator-DPHIMK44.js → orchestrator-JNSQDRZI.js} +5 -5
  24. package/dist/{orchestrator-D2EJ4Z7Z.js → orchestrator-NCYKEI3E.js} +5 -5
  25. package/dist/{thread-store-M4B52FUS.js → thread-store-2SS5V5CN.js} +3 -1
  26. package/dist/{thread-store-CO77HV2K.js → thread-store-ZGVWPVHP.js} +3 -1
  27. package/dist/{workspaces-HEKFQP4B.js → workspaces-PEWYWVHZ.js} +3 -3
  28. package/dist/{workspaces-DZZQM745.js → workspaces-RP76JH3J.js} +3 -3
  29. package/dist/{worktree-IEUSQ63V.js → worktree-72TZWUSH.js} +2 -2
  30. package/dist/{worktree-ENRMJUI3.js → worktree-ZQEUKSNE.js} +2 -2
  31. package/package.json +1 -1
@@ -50,14 +50,14 @@ import {
50
50
  resolveQuotaFallbackAgent,
51
51
  turnCostUsdFromCursorUsage,
52
52
  whichOnPath
53
- } from "./chunk-5XSDGJMP.js";
54
- import "./chunk-EWDE54OI.js";
53
+ } from "./chunk-NIVF5NDN.js";
54
+ import "./chunk-54RSAMBH.js";
55
55
  import "./chunk-3OHR73VK.js";
56
56
  import "./chunk-Y4MIXGPA.js";
57
57
  import "./chunk-VKQGAWHY.js";
58
- import "./chunk-NXM45OS3.js";
58
+ import "./chunk-RPX6VDW7.js";
59
59
  import "./chunk-D6JWYJ4P.js";
60
- import "./chunk-CJFBSQIB.js";
60
+ import "./chunk-INNLWYXW.js";
61
61
  import "./chunk-SYFVUF2C.js";
62
62
  import {
63
63
  conductorBundledBinDir,
@@ -44,9 +44,9 @@ import {
44
44
  resolveLoginCommand,
45
45
  resolveQuotaFallbackAgent,
46
46
  whichOnPath
47
- } from "./chunk-PKUPOVKP.js";
48
- import "./chunk-PDMNYCPL.js";
49
- import "./chunk-OSPE25A7.js";
47
+ } from "./chunk-A2TAKYSG.js";
48
+ import "./chunk-LJHC62LZ.js";
49
+ import "./chunk-STPZQR5B.js";
50
50
  import "./chunk-6K64FJDD.js";
51
51
  import "./chunk-QQKDGPUI.js";
52
52
  import "./chunk-SALM35KD.js";
@@ -67,7 +67,7 @@ import {
67
67
  import "./chunk-4TR3HZFT.js";
68
68
  import "./chunk-WDRMZKVB.js";
69
69
  import "./chunk-JT7R45JB.js";
70
- import "./chunk-KJBYIIJU.js";
70
+ import "./chunk-DFUES6QU.js";
71
71
  import "./chunk-77WWLBCI.js";
72
72
  import "./chunk-WFUDY6PC.js";
73
73
  import {
@@ -38,7 +38,7 @@ import {
38
38
  summarizeTurnStderr,
39
39
  toolDescription,
40
40
  turnFailChatText
41
- } from "./chunk-5XSDGJMP.js";
41
+ } from "./chunk-NIVF5NDN.js";
42
42
  import {
43
43
  SLACK_REPLY_FORMATTING,
44
44
  addWorkspace,
@@ -61,7 +61,7 @@ import {
61
61
  stageAbsolutePathsAsAttachments,
62
62
  stageBuffersAsAttachments,
63
63
  syncWorkspacesFromThreads
64
- } from "./chunk-EWDE54OI.js";
64
+ } from "./chunk-54RSAMBH.js";
65
65
  import {
66
66
  extractPresentedPlan,
67
67
  readPlanFile,
@@ -116,7 +116,7 @@ import {
116
116
  worktreeDisplayLabelForGroup,
117
117
  worktreeNameFromPath,
118
118
  worktreeSlugForTicket
119
- } from "./chunk-NXM45OS3.js";
119
+ } from "./chunk-RPX6VDW7.js";
120
120
  import {
121
121
  ATTACHMENTS_DIR,
122
122
  DETACHED_JOBS_DIR,
@@ -134,7 +134,7 @@ import {
134
134
  updateThread,
135
135
  withThreadLock,
136
136
  writeThread
137
- } from "./chunk-CJFBSQIB.js";
137
+ } from "./chunk-INNLWYXW.js";
138
138
  import {
139
139
  ensureWorktreeSideboardIgnored
140
140
  } from "./chunk-SYFVUF2C.js";
@@ -408,7 +408,7 @@ async function continueSourceThread(threadId, prompt) {
408
408
  await continueOnReply(threadId, prompt);
409
409
  return;
410
410
  }
411
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-D2EJ4Z7Z.js");
411
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-NCYKEI3E.js");
412
412
  await getOrchestrator2().send(threadId, prompt);
413
413
  } catch {
414
414
  }
@@ -801,9 +801,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
801
801
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
802
802
  );
803
803
  }
804
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-VAO3BQP5.js");
804
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-NLLAPQJI.js");
805
805
  if (isGlobalThread2(thread)) {
806
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-AL62H73U.js");
806
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-BH4EHFOO.js");
807
807
  ensureGlobalCoordinatorCwd2(
808
808
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
809
809
  );
@@ -2630,6 +2630,9 @@ function childHaltNotice(child, status) {
2630
2630
  "This is information \u2014 not a user command. Resume with send_to_thread or tell the user. Do not treat this as a successful turn."
2631
2631
  ].join("\n");
2632
2632
  }
2633
+ function shouldNotifyParentAfterTurnError(opts) {
2634
+ return !opts.quotaFailoverHandled && !opts.crashContinued;
2635
+ }
2633
2636
  function shouldNotifyParentOfChildHalt(opts) {
2634
2637
  if (!isIncompleteChildStatus(opts.status)) return false;
2635
2638
  if (!opts.child.parentThreadId) return false;
@@ -4186,7 +4189,7 @@ async function adoptThread(input) {
4186
4189
  messages: input.messages ?? []
4187
4190
  });
4188
4191
  writeThread(thread);
4189
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-HEKFQP4B.js");
4192
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-PEWYWVHZ.js");
4190
4193
  await ensureWorkspace2(repoPath);
4191
4194
  const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-N5X5I422.js");
4192
4195
  await ensureWorktreeSideboardIgnored2(input.worktreePath);
@@ -6564,7 +6567,7 @@ function formatScheduledPrompt(name, prompt) {
6564
6567
  ${prompt}`;
6565
6568
  }
6566
6569
  async function defaultDeps() {
6567
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-D2EJ4Z7Z.js");
6570
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-NCYKEI3E.js");
6568
6571
  const orch = getOrchestrator2();
6569
6572
  return {
6570
6573
  findThread: (id) => findThreadByRef(id),
@@ -6955,9 +6958,9 @@ var Orchestrator = class {
6955
6958
  */
6956
6959
  async maybeHandleOrchestrationQuotaFailover(threadId, limitText) {
6957
6960
  const thread = findThreadByRef(threadId);
6958
- if (!thread) return;
6961
+ if (!thread) return false;
6959
6962
  const plan = planOrchestrationQuotaFailover(thread, limitText);
6960
- if (!plan || plan.action === "none") return;
6963
+ if (!plan || plan.action === "none") return false;
6961
6964
  if (plan.action === "wait_reset" && plan.resumeAt) {
6962
6965
  this.haltDrain.add(threadId);
6963
6966
  this.scheduleQuotaResume(threadId, plan.resumeAt);
@@ -6975,7 +6978,7 @@ var Orchestrator = class {
6975
6978
  resumeAt: plan.resumeAt.toISOString()
6976
6979
  });
6977
6980
  this.emit({ type: "status_changed", threadId, status: "idle" });
6978
- return;
6981
+ return true;
6979
6982
  }
6980
6983
  if (plan.action === "switch_agent" && plan.fallbackAgent) {
6981
6984
  this.haltDrain.add(threadId);
@@ -7006,11 +7009,13 @@ var Orchestrator = class {
7006
7009
  threadId: next.id,
7007
7010
  status: next.status
7008
7011
  });
7009
- await this.send(
7012
+ void this.send(
7010
7013
  next.id,
7011
7014
  QUOTA_CONTINUE_PROMPT(thread.agent, plan.fallbackAgent)
7012
7015
  );
7016
+ return true;
7013
7017
  }
7018
+ return false;
7014
7019
  }
7015
7020
  /**
7016
7021
  * Cursor-style recovery: after a runner crash, feed the error back as the
@@ -7734,13 +7739,19 @@ var Orchestrator = class {
7734
7739
  this.maybeEnqueueJobContinue(threadId, chatText, parts);
7735
7740
  } else {
7736
7741
  const blob = [chatText, detail].filter(Boolean).join("\n");
7737
- void this.maybeHandleOrchestrationQuotaFailover(threadId, blob);
7742
+ const failedOver = await this.maybeHandleOrchestrationQuotaFailover(
7743
+ threadId,
7744
+ blob
7745
+ );
7738
7746
  this.maybeEnqueueCrashContinue(threadId, {
7739
7747
  detail: detail || failDetail,
7740
7748
  assistantText: chatText,
7741
7749
  partsCount: parts.length
7742
7750
  });
7743
- if (!this.crashContinued.has(threadId)) {
7751
+ if (shouldNotifyParentAfterTurnError({
7752
+ quotaFailoverHandled: failedOver,
7753
+ crashContinued: this.crashContinued.has(threadId)
7754
+ })) {
7744
7755
  const failed = readThread(threadId);
7745
7756
  if (failed) {
7746
7757
  notifyParentOfChildHalt(failed, "error", (id, prompt2) => this.send(id, prompt2));
@@ -7764,13 +7775,19 @@ var Orchestrator = class {
7764
7775
  this.emit({ type: "status_changed", threadId, status: "error" });
7765
7776
  }
7766
7777
  this.emit({ type: "turn_finished", threadId, exitCode: 1 });
7767
- void this.maybeHandleOrchestrationQuotaFailover(threadId, message);
7778
+ const failedOver = await this.maybeHandleOrchestrationQuotaFailover(
7779
+ threadId,
7780
+ message
7781
+ );
7768
7782
  this.maybeEnqueueCrashContinue(threadId, {
7769
7783
  detail: message,
7770
7784
  assistantText: "",
7771
7785
  partsCount: 0
7772
7786
  });
7773
- if (!this.crashContinued.has(threadId)) {
7787
+ if (shouldNotifyParentAfterTurnError({
7788
+ quotaFailoverHandled: failedOver,
7789
+ crashContinued: this.crashContinued.has(threadId)
7790
+ })) {
7774
7791
  const failed = readThread(threadId);
7775
7792
  if (failed) {
7776
7793
  notifyParentOfChildHalt(failed, "error", (id, prompt2) => this.send(id, prompt2));
@@ -8719,7 +8736,7 @@ var Orchestrator = class {
8719
8736
  this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
8720
8737
  if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
8721
8738
  try {
8722
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-HEKFQP4B.js");
8739
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-PEWYWVHZ.js");
8723
8740
  await ensureWorkspace2(thread.repoPath);
8724
8741
  } catch {
8725
8742
  }
@@ -8773,7 +8790,7 @@ var Orchestrator = class {
8773
8790
  `Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
8774
8791
  );
8775
8792
  }
8776
- const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-ENRMJUI3.js");
8793
+ const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-ZQEUKSNE.js");
8777
8794
  const slug = thread.worktreePath.split("/").pop();
8778
8795
  const dest = thread.worktreePath;
8779
8796
  await withRepoGitLock(thread.repoPath, async () => {
@@ -8883,7 +8900,7 @@ async function startOrchestration(opts) {
8883
8900
  sourceRef: "default",
8884
8901
  ...createOpts
8885
8902
  }).catch(async () => {
8886
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-ENRMJUI3.js");
8903
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-ZQEUKSNE.js");
8887
8904
  const repo = await resolveRepoRoot2(repoPath);
8888
8905
  const def = await resolveDefaultBranch2(repo);
8889
8906
  return orch.createThread({
@@ -8893,7 +8910,7 @@ async function startOrchestration(opts) {
8893
8910
  repoPath: repo
8894
8911
  });
8895
8912
  });
8896
- const { updateThread: upd } = await import("./thread-store-CO77HV2K.js");
8913
+ const { updateThread: upd } = await import("./thread-store-ZGVWPVHP.js");
8897
8914
  const updated = upd(thread.id, {
8898
8915
  sourceType: "orchestration",
8899
8916
  sourceRef: goal
@@ -7,7 +7,7 @@ import {
7
7
  resolveRepoRoot,
8
8
  takenSlugsFromThread,
9
9
  teamSlugFromName
10
- } from "./chunk-NXM45OS3.js";
10
+ } from "./chunk-RPX6VDW7.js";
11
11
  import {
12
12
  ATTACHMENTS_DIR,
13
13
  attachmentsGitignoreBody
@@ -17,7 +17,7 @@ import {
17
17
  listThreads,
18
18
  updateThread,
19
19
  writeThread
20
- } from "./chunk-CJFBSQIB.js";
20
+ } from "./chunk-INNLWYXW.js";
21
21
  import {
22
22
  assertOrchestratorCapableAgent,
23
23
  formatAccountProfilePlaybookLine,
@@ -16,6 +16,7 @@ import {
16
16
  isInternalAgentStatusText,
17
17
  isPollWrapperToolName,
18
18
  isSessionQuotaLimit,
19
+ lastAssistantMessageText,
19
20
  liveActivitySummary,
20
21
  normalizeParseResult,
21
22
  parseBrightsyCliLine,
@@ -25,7 +26,7 @@ import {
25
26
  stripBrightsyNdjsonNoise,
26
27
  sumUsageList,
27
28
  toolDescription
28
- } from "./chunk-PKUPOVKP.js";
29
+ } from "./chunk-A2TAKYSG.js";
29
30
  import {
30
31
  SLACK_REPLY_FORMATTING,
31
32
  addWorkspace,
@@ -48,7 +49,7 @@ import {
48
49
  stageAbsolutePathsAsAttachments,
49
50
  stageBuffersAsAttachments,
50
51
  syncWorkspacesFromThreads
51
- } from "./chunk-PDMNYCPL.js";
52
+ } from "./chunk-LJHC62LZ.js";
52
53
  import {
53
54
  addPrStackLayer,
54
55
  allocateTeamName,
@@ -98,7 +99,7 @@ import {
98
99
  worktreeDisplayLabelForGroup,
99
100
  worktreeNameFromPath,
100
101
  worktreeSlugForTicket
101
- } from "./chunk-OSPE25A7.js";
102
+ } from "./chunk-STPZQR5B.js";
102
103
  import {
103
104
  ATTACHMENTS_DIR,
104
105
  DETACHED_JOBS_DIR,
@@ -179,7 +180,7 @@ import {
179
180
  updateThread,
180
181
  withThreadLock,
181
182
  writeThread
182
- } from "./chunk-KJBYIIJU.js";
183
+ } from "./chunk-DFUES6QU.js";
183
184
  import {
184
185
  appDataDir,
185
186
  findConventionSetup,
@@ -473,7 +474,7 @@ async function continueSourceThread(threadId, prompt) {
473
474
  await continueOnReply(threadId, prompt);
474
475
  return;
475
476
  }
476
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-DPHIMK44.js");
477
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-JNSQDRZI.js");
477
478
  await getOrchestrator2().send(threadId, prompt);
478
479
  } catch {
479
480
  }
@@ -807,9 +808,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
807
808
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
808
809
  );
809
810
  }
810
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-Y5KKGXN7.js");
811
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-5AZEEQRU.js");
811
812
  if (isGlobalThread2(thread)) {
812
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-2RWBH6W7.js");
813
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-TY5FHAXC.js");
813
814
  ensureGlobalCoordinatorCwd2(
814
815
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
815
816
  );
@@ -2717,6 +2718,9 @@ function childHaltNotice(child, status) {
2717
2718
  "This is information \u2014 not a user command. Resume with send_to_thread or tell the user. Do not treat this as a successful turn."
2718
2719
  ].join("\n");
2719
2720
  }
2721
+ function shouldNotifyParentAfterTurnError(opts) {
2722
+ return !opts.quotaFailoverHandled && !opts.crashContinued;
2723
+ }
2720
2724
  function shouldNotifyParentOfChildHalt(opts) {
2721
2725
  if (!isIncompleteChildStatus(opts.status)) return false;
2722
2726
  if (!opts.child.parentThreadId) return false;
@@ -3543,6 +3547,35 @@ function visiblePage(items, shown) {
3543
3547
  hidden: Math.max(0, items.length - n)
3544
3548
  };
3545
3549
  }
3550
+ function markdownPreviewSource(text, max = 480) {
3551
+ const trimmed = text.trim();
3552
+ if (trimmed.length <= max) return trimmed;
3553
+ const slice = trimmed.slice(0, max);
3554
+ const nl = slice.lastIndexOf("\n");
3555
+ if (nl > 40) return slice.slice(0, nl);
3556
+ const sp = slice.lastIndexOf(" ");
3557
+ return sp > 40 ? slice.slice(0, sp) : slice;
3558
+ }
3559
+ function latestVisibleMessageText(messages, liveParts) {
3560
+ const live = lastAssistantMessageText(liveParts);
3561
+ if (live) return live;
3562
+ if (!messages?.length) return "";
3563
+ for (let i = messages.length - 1; i >= 0; i--) {
3564
+ const m = messages[i];
3565
+ if (!m) continue;
3566
+ if (m.role === "agent") {
3567
+ const fromParts = lastAssistantMessageText(m.parts);
3568
+ const text = (fromParts || m.text || "").trim();
3569
+ if (text && !isInternalAgentStatusText(text)) return text;
3570
+ continue;
3571
+ }
3572
+ if (m.role === "user") {
3573
+ const text = m.text?.trim();
3574
+ if (text) return text;
3575
+ }
3576
+ }
3577
+ return "";
3578
+ }
3546
3579
  function emptyColumns() {
3547
3580
  return {
3548
3581
  backlog: [],
@@ -3888,7 +3921,7 @@ async function createThread(input, _onSetupLine) {
3888
3921
  return readThread(thread.id) ?? thread;
3889
3922
  }
3890
3923
  async function listLinearIssues(agent, repoPath) {
3891
- const { getAdapter: getAdapter2 } = await import("./agents-ZRIFDXCB.js");
3924
+ const { getAdapter: getAdapter2 } = await import("./agents-OXX3ONVY.js");
3892
3925
  await requireAgent(agent, { requireLinear: true });
3893
3926
  const adapter = getAdapter2(agent);
3894
3927
  if (!adapter.listLinearIssues) {
@@ -4327,7 +4360,7 @@ async function adoptThread(input) {
4327
4360
  messages: input.messages ?? []
4328
4361
  });
4329
4362
  writeThread(thread);
4330
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-DZZQM745.js");
4363
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-RP76JH3J.js");
4331
4364
  await ensureWorkspace2(repoPath);
4332
4365
  const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-X54WSOXM.js");
4333
4366
  await ensureWorktreeSideboardIgnored2(input.worktreePath);
@@ -6911,7 +6944,7 @@ function formatScheduledPrompt(name, prompt) {
6911
6944
  ${prompt}`;
6912
6945
  }
6913
6946
  async function defaultDeps() {
6914
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-DPHIMK44.js");
6947
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-JNSQDRZI.js");
6915
6948
  const orch = getOrchestrator2();
6916
6949
  return {
6917
6950
  findThread: (id) => findThreadByRef(id),
@@ -7302,9 +7335,9 @@ var Orchestrator = class {
7302
7335
  */
7303
7336
  async maybeHandleOrchestrationQuotaFailover(threadId, limitText) {
7304
7337
  const thread = findThreadByRef(threadId);
7305
- if (!thread) return;
7338
+ if (!thread) return false;
7306
7339
  const plan = planOrchestrationQuotaFailover(thread, limitText);
7307
- if (!plan || plan.action === "none") return;
7340
+ if (!plan || plan.action === "none") return false;
7308
7341
  if (plan.action === "wait_reset" && plan.resumeAt) {
7309
7342
  this.haltDrain.add(threadId);
7310
7343
  this.scheduleQuotaResume(threadId, plan.resumeAt);
@@ -7322,7 +7355,7 @@ var Orchestrator = class {
7322
7355
  resumeAt: plan.resumeAt.toISOString()
7323
7356
  });
7324
7357
  this.emit({ type: "status_changed", threadId, status: "idle" });
7325
- return;
7358
+ return true;
7326
7359
  }
7327
7360
  if (plan.action === "switch_agent" && plan.fallbackAgent) {
7328
7361
  this.haltDrain.add(threadId);
@@ -7353,11 +7386,13 @@ var Orchestrator = class {
7353
7386
  threadId: next.id,
7354
7387
  status: next.status
7355
7388
  });
7356
- await this.send(
7389
+ void this.send(
7357
7390
  next.id,
7358
7391
  QUOTA_CONTINUE_PROMPT(thread.agent, plan.fallbackAgent)
7359
7392
  );
7393
+ return true;
7360
7394
  }
7395
+ return false;
7361
7396
  }
7362
7397
  /**
7363
7398
  * Cursor-style recovery: after a runner crash, feed the error back as the
@@ -8081,13 +8116,19 @@ var Orchestrator = class {
8081
8116
  this.maybeEnqueueJobContinue(threadId, chatText, parts);
8082
8117
  } else {
8083
8118
  const blob = [chatText, detail].filter(Boolean).join("\n");
8084
- void this.maybeHandleOrchestrationQuotaFailover(threadId, blob);
8119
+ const failedOver = await this.maybeHandleOrchestrationQuotaFailover(
8120
+ threadId,
8121
+ blob
8122
+ );
8085
8123
  this.maybeEnqueueCrashContinue(threadId, {
8086
8124
  detail: detail || failDetail,
8087
8125
  assistantText: chatText,
8088
8126
  partsCount: parts.length
8089
8127
  });
8090
- if (!this.crashContinued.has(threadId)) {
8128
+ if (shouldNotifyParentAfterTurnError({
8129
+ quotaFailoverHandled: failedOver,
8130
+ crashContinued: this.crashContinued.has(threadId)
8131
+ })) {
8091
8132
  const failed = readThread(threadId);
8092
8133
  if (failed) {
8093
8134
  notifyParentOfChildHalt(failed, "error", (id, prompt2) => this.send(id, prompt2));
@@ -8111,13 +8152,19 @@ var Orchestrator = class {
8111
8152
  this.emit({ type: "status_changed", threadId, status: "error" });
8112
8153
  }
8113
8154
  this.emit({ type: "turn_finished", threadId, exitCode: 1 });
8114
- void this.maybeHandleOrchestrationQuotaFailover(threadId, message);
8155
+ const failedOver = await this.maybeHandleOrchestrationQuotaFailover(
8156
+ threadId,
8157
+ message
8158
+ );
8115
8159
  this.maybeEnqueueCrashContinue(threadId, {
8116
8160
  detail: message,
8117
8161
  assistantText: "",
8118
8162
  partsCount: 0
8119
8163
  });
8120
- if (!this.crashContinued.has(threadId)) {
8164
+ if (shouldNotifyParentAfterTurnError({
8165
+ quotaFailoverHandled: failedOver,
8166
+ crashContinued: this.crashContinued.has(threadId)
8167
+ })) {
8121
8168
  const failed = readThread(threadId);
8122
8169
  if (failed) {
8123
8170
  notifyParentOfChildHalt(failed, "error", (id, prompt2) => this.send(id, prompt2));
@@ -9066,7 +9113,7 @@ var Orchestrator = class {
9066
9113
  this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
9067
9114
  if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
9068
9115
  try {
9069
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-DZZQM745.js");
9116
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-RP76JH3J.js");
9070
9117
  await ensureWorkspace2(thread.repoPath);
9071
9118
  } catch {
9072
9119
  }
@@ -9120,7 +9167,7 @@ var Orchestrator = class {
9120
9167
  `Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
9121
9168
  );
9122
9169
  }
9123
- const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-IEUSQ63V.js");
9170
+ const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-72TZWUSH.js");
9124
9171
  const slug = thread.worktreePath.split("/").pop();
9125
9172
  const dest = thread.worktreePath;
9126
9173
  await withRepoGitLock(thread.repoPath, async () => {
@@ -9230,7 +9277,7 @@ async function startOrchestration(opts) {
9230
9277
  sourceRef: "default",
9231
9278
  ...createOpts
9232
9279
  }).catch(async () => {
9233
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-IEUSQ63V.js");
9280
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-72TZWUSH.js");
9234
9281
  const repo = await resolveRepoRoot2(repoPath);
9235
9282
  const def = await resolveDefaultBranch2(repo);
9236
9283
  return orch.createThread({
@@ -9240,7 +9287,7 @@ async function startOrchestration(opts) {
9240
9287
  repoPath: repo
9241
9288
  });
9242
9289
  });
9243
- const { updateThread: upd } = await import("./thread-store-M4B52FUS.js");
9290
+ const { updateThread: upd } = await import("./thread-store-2SS5V5CN.js");
9244
9291
  const updated = upd(thread.id, {
9245
9292
  sourceType: "orchestration",
9246
9293
  sourceRef: goal
@@ -9252,6 +9299,28 @@ async function startOrchestration(opts) {
9252
9299
  }
9253
9300
 
9254
9301
  export {
9302
+ isHomeBoardThread,
9303
+ BOARD_COLUMN_DEFS,
9304
+ HOME_BOARD_CACHE_TTL_MS,
9305
+ DEFAULT_WORKTREE_SORT,
9306
+ groupHomeBoardWorktrees,
9307
+ classifyWorktreeColumn,
9308
+ worktreeBoardStatus,
9309
+ dedupeBoardIssues,
9310
+ issueNeedsWorkspacePick,
9311
+ isAccountWideIssueSource,
9312
+ findLiveThreadForCreate,
9313
+ findLiveThreadForCreateSource,
9314
+ boardPinIdentity,
9315
+ findBoardPin,
9316
+ syncBoardPins,
9317
+ dedupeBoardPrs,
9318
+ markdownPreviewSource,
9319
+ latestVisibleMessageText,
9320
+ findBoardIssue,
9321
+ findBoardPr,
9322
+ assembleHomeBoard,
9323
+ HOME_BOARD_AGENT_HINT,
9255
9324
  emptySetupLog,
9256
9325
  mergeSetupOutput,
9257
9326
  readSetupLog,
@@ -9387,26 +9456,6 @@ export {
9387
9456
  stopDetachedJob,
9388
9457
  detectAgents,
9389
9458
  requireAgent,
9390
- isHomeBoardThread,
9391
- BOARD_COLUMN_DEFS,
9392
- HOME_BOARD_CACHE_TTL_MS,
9393
- DEFAULT_WORKTREE_SORT,
9394
- groupHomeBoardWorktrees,
9395
- classifyWorktreeColumn,
9396
- worktreeBoardStatus,
9397
- dedupeBoardIssues,
9398
- issueNeedsWorkspacePick,
9399
- isAccountWideIssueSource,
9400
- findLiveThreadForCreate,
9401
- findLiveThreadForCreateSource,
9402
- boardPinIdentity,
9403
- findBoardPin,
9404
- syncBoardPins,
9405
- dedupeBoardPrs,
9406
- findBoardIssue,
9407
- findBoardPr,
9408
- assembleHomeBoard,
9409
- HOME_BOARD_AGENT_HINT,
9410
9459
  createThread,
9411
9460
  listLinearIssues,
9412
9461
  IMPLIED_TICKET_RESOLVE_PROMPT,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  isOrchestratorThread
3
- } from "./chunk-PDMNYCPL.js";
3
+ } from "./chunk-LJHC62LZ.js";
4
4
  import {
5
5
  codexUnattendedGitConfigArgs,
6
6
  mergeAgentGitAuthEnv,
7
7
  resolveAgentGitAuthEnv,
8
8
  resolveCodexGitWritableRoots
9
- } from "./chunk-OSPE25A7.js";
9
+ } from "./chunk-STPZQR5B.js";
10
10
  import {
11
11
  applyConnectedTeamToCli,
12
12
  brightsyMcpServerName,
@@ -1036,7 +1036,7 @@ function applyAgentEvent(parts, event) {
1036
1036
  next.push(
1037
1037
  withPartTimes({
1038
1038
  type: "thinking",
1039
- text: data,
1039
+ text: clipThinkingForStore(data),
1040
1040
  ...event.parentId ? { parentId: event.parentId } : {}
1041
1041
  })
1042
1042
  );
@@ -1937,7 +1937,7 @@ var claudeAdapter = {
1937
1937
  );
1938
1938
  }
1939
1939
  const mode = permissionMode(thread);
1940
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-Y5KKGXN7.js");
1940
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-5AZEEQRU.js");
1941
1941
  const isOrchestrator = isOrchestratorThread2(thread);
1942
1942
  const injectedServers = await buildInjectedMcpServers({
1943
1943
  includeSideboard: true,
@@ -4025,6 +4025,28 @@ function allAdapters() {
4025
4025
  }
4026
4026
 
4027
4027
  export {
4028
+ visibleToolRowDetail,
4029
+ toolDetail,
4030
+ toolDescription,
4031
+ isSubagentToolName,
4032
+ isInternalAgentStatusText,
4033
+ isPollWrapperToolName,
4034
+ isShellToolName,
4035
+ toolActivityLine,
4036
+ liveActivitySummary,
4037
+ messagePartParentId,
4038
+ withEventParentId,
4039
+ withEventsParentId,
4040
+ toolFilePath,
4041
+ THINKING_PART_MAX_CHARS,
4042
+ clipThinkingForStore,
4043
+ applyAgentEvent,
4044
+ partsToAssistantText,
4045
+ lastAssistantMessageText,
4046
+ stripBrightsyNdjsonNoise,
4047
+ isBrightsyNdjsonLine,
4048
+ finalizeParts,
4049
+ normalizeParseResult,
4028
4050
  fromInclusiveInputUsage,
4029
4051
  requestOccupancy,
4030
4052
  mergeUsage,
@@ -4051,28 +4073,6 @@ export {
4051
4073
  sanitizeMcpServerName,
4052
4074
  mcpAllowTools,
4053
4075
  mcpAuthWarnings,
4054
- visibleToolRowDetail,
4055
- toolDetail,
4056
- toolDescription,
4057
- isSubagentToolName,
4058
- isInternalAgentStatusText,
4059
- isPollWrapperToolName,
4060
- isShellToolName,
4061
- toolActivityLine,
4062
- liveActivitySummary,
4063
- messagePartParentId,
4064
- withEventParentId,
4065
- withEventsParentId,
4066
- toolFilePath,
4067
- THINKING_PART_MAX_CHARS,
4068
- clipThinkingForStore,
4069
- applyAgentEvent,
4070
- partsToAssistantText,
4071
- lastAssistantMessageText,
4072
- stripBrightsyNdjsonNoise,
4073
- isBrightsyNdjsonLine,
4074
- finalizeParts,
4075
- normalizeParseResult,
4076
4076
  SIDEBOARD_MCP_PROFILE_ENV,
4077
4077
  WORKTREE_MCP_TOOLS,
4078
4078
  WORKTREE_GITHUB_MCP_TOOLS,
@@ -137,6 +137,10 @@ function forgetThread(id) {
137
137
  function invalidateThreadListCache() {
138
138
  listCache = null;
139
139
  }
140
+ function invalidateThreadRecord(id) {
141
+ if (!id) return;
142
+ forgetThread(id);
143
+ }
140
144
  function readThread(id) {
141
145
  const path = threadFilePath(id);
142
146
  const mtimeMs = fileMtimeMs(path);
@@ -229,6 +233,7 @@ export {
229
233
  createEmptyThread,
230
234
  withThreadLock,
231
235
  invalidateThreadListCache,
236
+ invalidateThreadRecord,
232
237
  readThread,
233
238
  writeThread,
234
239
  isThreadRecordFile,
@@ -139,6 +139,10 @@ function forgetThread(id) {
139
139
  function invalidateThreadListCache() {
140
140
  listCache = null;
141
141
  }
142
+ function invalidateThreadRecord(id) {
143
+ if (!id) return;
144
+ forgetThread(id);
145
+ }
142
146
  function readThread(id) {
143
147
  const path = threadFilePath(id);
144
148
  const mtimeMs = fileMtimeMs(path);
@@ -231,6 +235,7 @@ export {
231
235
  createEmptyThread,
232
236
  withThreadLock,
233
237
  invalidateThreadListCache,
238
+ invalidateThreadRecord,
234
239
  readThread,
235
240
  writeThread,
236
241
  isThreadRecordFile,