@sideboard-ai/core 0.1.207 → 0.1.208

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-KCBCFMFW.js → agents-CCS5IEBV.js} +4 -4
  2. package/dist/{agents-7MULGRPU.js → agents-QHQXR55O.js} +4 -4
  3. package/dist/{chunk-ARR4OGLY.js → chunk-7DKX5JLT.js} +2 -0
  4. package/dist/{chunk-ZU7R35NY.js → chunk-7PEIIN7P.js} +28 -3
  5. package/dist/{chunk-A2BRWIEM.js → chunk-A6SOSLUV.js} +30 -3
  6. package/dist/{chunk-2GPZ4BAU.js → chunk-C5MNMITQ.js} +53 -20
  7. package/dist/{chunk-5UQTT4S7.js → chunk-C6ZNQV5W.js} +50 -19
  8. package/dist/{chunk-QOJB5PC7.js → chunk-DNTPX6HV.js} +2 -2
  9. package/dist/{chunk-PAQPT3JO.js → chunk-HA4EZKFY.js} +2 -2
  10. package/dist/{chunk-N4A4NWFO.js → chunk-NJ2CCLV6.js} +1 -1
  11. package/dist/{chunk-6KH4OBEW.js → chunk-OP6CFVTB.js} +1 -1
  12. package/dist/{chunk-DWGEBZ3C.js → chunk-ZHCB4CKR.js} +2 -0
  13. package/dist/{coordinator-prompt-6NV2IHEX.js → coordinator-prompt-TUHB6ZFA.js} +3 -3
  14. package/dist/{coordinator-prompt-6A3D7BV3.js → coordinator-prompt-WOTJQMD5.js} +3 -3
  15. package/dist/{global-workspace-VS6HZF2I.js → global-workspace-5UUUNA4A.js} +3 -3
  16. package/dist/{global-workspace-I2X6UQMX.js → global-workspace-V6G2KH2V.js} +3 -3
  17. package/dist/index.cjs +81 -7
  18. package/dist/index.d.cts +35 -2
  19. package/dist/index.d.ts +35 -2
  20. package/dist/index.js +16 -5
  21. package/dist/mcp/run-stdio.cjs +69 -7
  22. package/dist/mcp/run-stdio.js +5 -5
  23. package/dist/{orchestrator-7WF32ZXJ.js → orchestrator-4IGHVRAF.js} +5 -5
  24. package/dist/{orchestrator-CXQY5YRG.js → orchestrator-D4AQNF25.js} +5 -5
  25. package/dist/{thread-store-XGYWXR2P.js → thread-store-ESZYZSVC.js} +1 -1
  26. package/dist/{thread-store-LS2T6RVH.js → thread-store-FMWDFAO5.js} +1 -1
  27. package/dist/{workspaces-CEU25ANO.js → workspaces-CLNANACI.js} +3 -3
  28. package/dist/{workspaces-7PM7UGLG.js → workspaces-PZ36M7EQ.js} +3 -3
  29. package/dist/{worktree-YD7Y6NRY.js → worktree-JKTM47K5.js} +2 -2
  30. package/dist/{worktree-T6PCOIHZ.js → worktree-NC4XQNQI.js} +2 -2
  31. package/package.json +1 -1
@@ -44,9 +44,9 @@ import {
44
44
  resolveLoginCommand,
45
45
  resolveQuotaFallbackAgent,
46
46
  whichOnPath
47
- } from "./chunk-A2BRWIEM.js";
48
- import "./chunk-PAQPT3JO.js";
49
- import "./chunk-6KH4OBEW.js";
47
+ } from "./chunk-A6SOSLUV.js";
48
+ import "./chunk-HA4EZKFY.js";
49
+ import "./chunk-OP6CFVTB.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-ARR4OGLY.js";
70
+ import "./chunk-7DKX5JLT.js";
71
71
  import "./chunk-77WWLBCI.js";
72
72
  import "./chunk-WFUDY6PC.js";
73
73
  import {
@@ -50,14 +50,14 @@ import {
50
50
  resolveQuotaFallbackAgent,
51
51
  turnCostUsdFromCursorUsage,
52
52
  whichOnPath
53
- } from "./chunk-ZU7R35NY.js";
54
- import "./chunk-QOJB5PC7.js";
53
+ } from "./chunk-7PEIIN7P.js";
54
+ import "./chunk-DNTPX6HV.js";
55
55
  import "./chunk-3OHR73VK.js";
56
56
  import "./chunk-Y4MIXGPA.js";
57
57
  import "./chunk-VKQGAWHY.js";
58
- import "./chunk-N4A4NWFO.js";
58
+ import "./chunk-NJ2CCLV6.js";
59
59
  import "./chunk-D6JWYJ4P.js";
60
- import "./chunk-DWGEBZ3C.js";
60
+ import "./chunk-ZHCB4CKR.js";
61
61
  import "./chunk-SYFVUF2C.js";
62
62
  import {
63
63
  conductorBundledBinDir,
@@ -41,6 +41,7 @@ function normalizeThread(raw) {
41
41
  lastError: raw.lastError ?? null,
42
42
  agentPid: raw.agentPid ?? null,
43
43
  attachments: Array.isArray(raw.attachments) ? raw.attachments : [],
44
+ pendingTurnAttachments: Array.isArray(raw.pendingTurnAttachments) ? raw.pendingTurnAttachments : [],
44
45
  prTitle: raw.prTitle ?? null,
45
46
  prState: raw.prState ?? null,
46
47
  prIsDraft: Boolean(raw.prIsDraft),
@@ -83,6 +84,7 @@ function createEmptyThread(partial) {
83
84
  userSetTitle: partial.userSetTitle ?? false,
84
85
  messages: partial.messages ?? [],
85
86
  attachments: partial.attachments ?? [],
87
+ pendingTurnAttachments: partial.pendingTurnAttachments ?? [],
86
88
  createdAt: ts,
87
89
  updatedAt: ts,
88
90
  title: partial.title,
@@ -2,7 +2,7 @@
2
2
 
3
3
  import {
4
4
  isOrchestratorThread
5
- } from "./chunk-QOJB5PC7.js";
5
+ } from "./chunk-DNTPX6HV.js";
6
6
  import {
7
7
  applyConnectedTeamToCli,
8
8
  brightsyMcpServerName,
@@ -20,7 +20,7 @@ import {
20
20
  mergeAgentGitAuthEnv,
21
21
  resolveAgentGitAuthEnv,
22
22
  resolveCodexGitWritableRoots
23
- } from "./chunk-N4A4NWFO.js";
23
+ } from "./chunk-NJ2CCLV6.js";
24
24
  import {
25
25
  enrichPathWithNpmGlobalBin,
26
26
  isConductorBundledCli,
@@ -1161,6 +1161,30 @@ function clipThinkingForStore(text, max = THINKING_PART_MAX_CHARS) {
1161
1161
  const marker = "\u2026(earlier thinking trimmed)\n";
1162
1162
  return marker + text.slice(text.length - Math.max(1, max - marker.length));
1163
1163
  }
1164
+ var STDOUT_EVENT_MAX_CHARS = 16e3;
1165
+ var STDERR_EVENT_MAX_CHARS = 4e3;
1166
+ function clipEventTail(text, max) {
1167
+ if (text.length <= max) return text;
1168
+ const marker = "\u2026(truncated)\n";
1169
+ return marker + text.slice(text.length - Math.max(1, max - marker.length));
1170
+ }
1171
+ function clipAgentEventForPaint(event) {
1172
+ if (event.type === "tool_result" && event.content) {
1173
+ const content = clipToolResultForStore(event.content);
1174
+ if (content === event.content) return event;
1175
+ return { ...event, content };
1176
+ }
1177
+ if (event.type === "thinking" && event.data.length > THINKING_PART_MAX_CHARS) {
1178
+ return { ...event, data: clipThinkingForStore(event.data) };
1179
+ }
1180
+ if (event.type === "stdout" && event.data.length > STDOUT_EVENT_MAX_CHARS) {
1181
+ return { ...event, data: clipEventTail(event.data, STDOUT_EVENT_MAX_CHARS) };
1182
+ }
1183
+ if (event.type === "stderr" && event.data.length > STDERR_EVENT_MAX_CHARS) {
1184
+ return { ...event, data: clipEventTail(event.data, STDERR_EVENT_MAX_CHARS) };
1185
+ }
1186
+ return event;
1187
+ }
1164
1188
  function withPartTimes(next, prev) {
1165
1189
  const now = Date.now();
1166
1190
  const startedAt = prev && typeof prev.startedAt === "number" ? prev.startedAt : now;
@@ -2450,7 +2474,7 @@ var claudeAdapter = {
2450
2474
  );
2451
2475
  }
2452
2476
  const mode = permissionMode(thread);
2453
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-I2X6UQMX.js");
2477
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-V6G2KH2V.js");
2454
2478
  const isOrchestrator = isOrchestratorThread2(thread);
2455
2479
  const injectedServers = await buildInjectedMcpServers({
2456
2480
  includeSideboard: true,
@@ -4798,6 +4822,7 @@ export {
4798
4822
  isInternalAgentStatusText,
4799
4823
  isPollWrapperToolName,
4800
4824
  liveActivitySummary,
4825
+ clipAgentEventForPaint,
4801
4826
  applyAgentEvent,
4802
4827
  partsToAssistantText,
4803
4828
  stripBrightsyNdjsonNoise,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  isOrchestratorThread
3
- } from "./chunk-PAQPT3JO.js";
3
+ } from "./chunk-HA4EZKFY.js";
4
4
  import {
5
5
  codexUnattendedGitConfigArgs,
6
6
  mergeAgentGitAuthEnv,
7
7
  resolveAgentGitAuthEnv,
8
8
  resolveCodexGitWritableRoots
9
- } from "./chunk-6KH4OBEW.js";
9
+ } from "./chunk-OP6CFVTB.js";
10
10
  import {
11
11
  applyConnectedTeamToCli,
12
12
  brightsyMcpServerName,
@@ -968,6 +968,30 @@ function clipThinkingForStore(text, max = THINKING_PART_MAX_CHARS) {
968
968
  const marker = "\u2026(earlier thinking trimmed)\n";
969
969
  return marker + text.slice(text.length - Math.max(1, max - marker.length));
970
970
  }
971
+ var STDOUT_EVENT_MAX_CHARS = 16e3;
972
+ var STDERR_EVENT_MAX_CHARS = 4e3;
973
+ function clipEventTail(text, max) {
974
+ if (text.length <= max) return text;
975
+ const marker = "\u2026(truncated)\n";
976
+ return marker + text.slice(text.length - Math.max(1, max - marker.length));
977
+ }
978
+ function clipAgentEventForPaint(event) {
979
+ if (event.type === "tool_result" && event.content) {
980
+ const content = clipToolResultForStore(event.content);
981
+ if (content === event.content) return event;
982
+ return { ...event, content };
983
+ }
984
+ if (event.type === "thinking" && event.data.length > THINKING_PART_MAX_CHARS) {
985
+ return { ...event, data: clipThinkingForStore(event.data) };
986
+ }
987
+ if (event.type === "stdout" && event.data.length > STDOUT_EVENT_MAX_CHARS) {
988
+ return { ...event, data: clipEventTail(event.data, STDOUT_EVENT_MAX_CHARS) };
989
+ }
990
+ if (event.type === "stderr" && event.data.length > STDERR_EVENT_MAX_CHARS) {
991
+ return { ...event, data: clipEventTail(event.data, STDERR_EVENT_MAX_CHARS) };
992
+ }
993
+ return event;
994
+ }
971
995
  function withPartTimes(next, prev) {
972
996
  const now = Date.now();
973
997
  const startedAt = prev && typeof prev.startedAt === "number" ? prev.startedAt : now;
@@ -1942,7 +1966,7 @@ var claudeAdapter = {
1942
1966
  );
1943
1967
  }
1944
1968
  const mode = permissionMode(thread);
1945
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-VS6HZF2I.js");
1969
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-5UUUNA4A.js");
1946
1970
  const isOrchestrator = isOrchestratorThread2(thread);
1947
1971
  const injectedServers = await buildInjectedMcpServers({
1948
1972
  includeSideboard: true,
@@ -4067,6 +4091,9 @@ export {
4067
4091
  toolFilePath,
4068
4092
  THINKING_PART_MAX_CHARS,
4069
4093
  clipThinkingForStore,
4094
+ STDOUT_EVENT_MAX_CHARS,
4095
+ STDERR_EVENT_MAX_CHARS,
4096
+ clipAgentEventForPaint,
4070
4097
  applyAgentEvent,
4071
4098
  partsToAssistantText,
4072
4099
  lastAssistantMessageText,
@@ -9,6 +9,7 @@ import {
9
9
  allAdapters,
10
10
  applyAgentEvent,
11
11
  applyTurnUsage,
12
+ clipAgentEventForPaint,
12
13
  contextTokens,
13
14
  finalizeParts,
14
15
  getAdapter,
@@ -26,7 +27,7 @@ import {
26
27
  stripBrightsyNdjsonNoise,
27
28
  sumUsageList,
28
29
  toolDescription
29
- } from "./chunk-A2BRWIEM.js";
30
+ } from "./chunk-A6SOSLUV.js";
30
31
  import {
31
32
  SLACK_REPLY_FORMATTING,
32
33
  addWorkspace,
@@ -49,7 +50,7 @@ import {
49
50
  stageAbsolutePathsAsAttachments,
50
51
  stageBuffersAsAttachments,
51
52
  syncWorkspacesFromThreads
52
- } from "./chunk-PAQPT3JO.js";
53
+ } from "./chunk-HA4EZKFY.js";
53
54
  import {
54
55
  addPrStackLayer,
55
56
  allocateTeamName,
@@ -99,7 +100,7 @@ import {
99
100
  worktreeDisplayLabelForGroup,
100
101
  worktreeNameFromPath,
101
102
  worktreeSlugForTicket
102
- } from "./chunk-6KH4OBEW.js";
103
+ } from "./chunk-OP6CFVTB.js";
103
104
  import {
104
105
  ATTACHMENTS_DIR,
105
106
  DETACHED_JOBS_DIR,
@@ -181,7 +182,7 @@ import {
181
182
  updateThread,
182
183
  withThreadLock,
183
184
  writeThread
184
- } from "./chunk-ARR4OGLY.js";
185
+ } from "./chunk-7DKX5JLT.js";
185
186
  import {
186
187
  appDataDir,
187
188
  findConventionSetup,
@@ -475,7 +476,7 @@ async function continueSourceThread(threadId, prompt) {
475
476
  await continueOnReply(threadId, prompt);
476
477
  return;
477
478
  }
478
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-CXQY5YRG.js");
479
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-D4AQNF25.js");
479
480
  await getOrchestrator2().send(threadId, prompt);
480
481
  } catch {
481
482
  }
@@ -809,9 +810,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
809
810
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
810
811
  );
811
812
  }
812
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-VS6HZF2I.js");
813
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-5UUUNA4A.js");
813
814
  if (isGlobalThread2(thread)) {
814
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-6A3D7BV3.js");
815
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-WOTJQMD5.js");
815
816
  ensureGlobalCoordinatorCwd2(
816
817
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
817
818
  );
@@ -3967,7 +3968,7 @@ async function createThread(input, _onSetupLine) {
3967
3968
  return readThread(thread.id) ?? thread;
3968
3969
  }
3969
3970
  async function listLinearIssues(agent, repoPath) {
3970
- const { getAdapter: getAdapter2 } = await import("./agents-KCBCFMFW.js");
3971
+ const { getAdapter: getAdapter2 } = await import("./agents-CCS5IEBV.js");
3971
3972
  await requireAgent(agent, { requireLinear: true });
3972
3973
  const adapter = getAdapter2(agent);
3973
3974
  if (!adapter.listLinearIssues) {
@@ -4413,7 +4414,7 @@ async function adoptThread(input) {
4413
4414
  messages: input.messages ?? []
4414
4415
  });
4415
4416
  writeThread(thread);
4416
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-7PM7UGLG.js");
4417
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-PZ36M7EQ.js");
4417
4418
  await ensureWorkspace2(repoPath);
4418
4419
  const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-X54WSOXM.js");
4419
4420
  await ensureWorktreeSideboardIgnored2(input.worktreePath);
@@ -6171,6 +6172,28 @@ function expandComposerPrompt(worktreePath, prompt, opts) {
6171
6172
  };
6172
6173
  }
6173
6174
 
6175
+ // src/composer/consume-attachments.ts
6176
+ function consumeComposerAttachments(thread) {
6177
+ if (thread.attachments.length === 0) {
6178
+ return {
6179
+ attachments: [],
6180
+ pendingTurnAttachments: thread.pendingTurnAttachments ?? []
6181
+ };
6182
+ }
6183
+ return {
6184
+ attachments: [],
6185
+ pendingTurnAttachments: [
6186
+ ...thread.pendingTurnAttachments ?? [],
6187
+ ...thread.attachments
6188
+ ]
6189
+ };
6190
+ }
6191
+ function takePendingTurnAttachments(thread) {
6192
+ const pending = thread.pendingTurnAttachments ?? [];
6193
+ if (pending.length === 0 && thread.attachments.length === 0) return [];
6194
+ return [...pending, ...thread.attachments];
6195
+ }
6196
+
6174
6197
  // src/agents/instructions.ts
6175
6198
  import { existsSync as existsSync17 } from "fs";
6176
6199
  import { join as join16 } from "path";
@@ -6997,7 +7020,7 @@ function formatScheduledPrompt(name, prompt) {
6997
7020
  ${prompt}`;
6998
7021
  }
6999
7022
  async function defaultDeps() {
7000
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-CXQY5YRG.js");
7023
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-D4AQNF25.js");
7001
7024
  const orch = getOrchestrator2();
7002
7025
  return {
7003
7026
  findThread: (id) => findThreadByRef(id),
@@ -7620,6 +7643,11 @@ var Orchestrator = class {
7620
7643
  const inFlight = this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id) || current.status === "running";
7621
7644
  shouldSteer = followUp === "steer" && (inFlight || current.queue.length > 0);
7622
7645
  const patch = { queue };
7646
+ if (current.attachments.length > 0) {
7647
+ const consumed = consumeComposerAttachments(current);
7648
+ patch.attachments = consumed.attachments;
7649
+ patch.pendingTurnAttachments = consumed.pendingTurnAttachments;
7650
+ }
7623
7651
  if (!inFlight) patch.status = "queued";
7624
7652
  const pid = current.agentPid;
7625
7653
  if (typeof pid === "number" && pid > 0 && !isPidAlive(pid)) {
@@ -7800,7 +7828,8 @@ var Orchestrator = class {
7800
7828
  thread = this.requireThread(threadId);
7801
7829
  }
7802
7830
  const autoContinue = isJobContinuePrompt(prompt) || prompt.trim().startsWith("The previous agent process ended before it finished.");
7803
- const sentAttachments = !autoContinue && thread.attachments.length > 0 ? [...thread.attachments] : void 0;
7831
+ const parked = takePendingTurnAttachments(thread);
7832
+ const sentAttachments = !autoContinue && parked.length > 0 ? parked : void 0;
7804
7833
  appendMessage(threadId, {
7805
7834
  role: "user",
7806
7835
  text: prompt,
@@ -7867,8 +7896,8 @@ var Orchestrator = class {
7867
7896
  slackReplyContext,
7868
7897
  expandedPrompt
7869
7898
  ].filter(Boolean).join("\n\n");
7870
- if (!autoContinue && thread.attachments.length > 0) {
7871
- updateThread(threadId, { attachments: [] });
7899
+ if (!autoContinue && sentAttachments) {
7900
+ updateThread(threadId, { attachments: [], pendingTurnAttachments: [] });
7872
7901
  }
7873
7902
  const adapter = getAdapter(thread.agent);
7874
7903
  const resolved = await adapter.resolveSessionId(thread.worktreePath, thread.sessionId);
@@ -7974,8 +8003,9 @@ var Orchestrator = class {
7974
8003
  isolateCodexPlugins: fresh.isolateCodexPlugins === true
7975
8004
  },
7976
8005
  (event) => {
7977
- this.emit({ type: "turn_output", threadId, event });
7978
- noteTurnLiveEvent(threadId, event);
8006
+ const paint = clipAgentEventForPaint(event);
8007
+ this.emit({ type: "turn_output", threadId, event: paint });
8008
+ noteTurnLiveEvent(threadId, paint);
7979
8009
  if (event.type === "session_id") {
7980
8010
  updateThread(threadId, { sessionId: event.data });
7981
8011
  }
@@ -8100,7 +8130,8 @@ var Orchestrator = class {
8100
8130
  isolateCodexPlugins: isolateCodexPluginRetry || retryThread.isolateCodexPlugins === true
8101
8131
  },
8102
8132
  (event) => {
8103
- this.emit({ type: "turn_output", threadId, event });
8133
+ const paint = clipAgentEventForPaint(event);
8134
+ this.emit({ type: "turn_output", threadId, event: paint });
8104
8135
  if (event.type === "session_id") {
8105
8136
  updateThread(threadId, { sessionId: event.data });
8106
8137
  }
@@ -9176,7 +9207,7 @@ var Orchestrator = class {
9176
9207
  this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
9177
9208
  if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
9178
9209
  try {
9179
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-7PM7UGLG.js");
9210
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-PZ36M7EQ.js");
9180
9211
  await ensureWorkspace2(thread.repoPath);
9181
9212
  } catch {
9182
9213
  }
@@ -9230,7 +9261,7 @@ var Orchestrator = class {
9230
9261
  `Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
9231
9262
  );
9232
9263
  }
9233
- const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-T6PCOIHZ.js");
9264
+ const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-NC4XQNQI.js");
9234
9265
  const slug = thread.worktreePath.split("/").pop();
9235
9266
  const dest = thread.worktreePath;
9236
9267
  await withRepoGitLock(thread.repoPath, async () => {
@@ -9340,7 +9371,7 @@ async function startOrchestration(opts) {
9340
9371
  sourceRef: "default",
9341
9372
  ...createOpts
9342
9373
  }).catch(async () => {
9343
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-T6PCOIHZ.js");
9374
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-NC4XQNQI.js");
9344
9375
  const repo = await resolveRepoRoot2(repoPath);
9345
9376
  const def = await resolveDefaultBranch2(repo);
9346
9377
  return orch.createThread({
@@ -9350,7 +9381,7 @@ async function startOrchestration(opts) {
9350
9381
  repoPath: repo
9351
9382
  });
9352
9383
  });
9353
- const { updateThread: upd } = await import("./thread-store-XGYWXR2P.js");
9384
+ const { updateThread: upd } = await import("./thread-store-ESZYZSVC.js");
9354
9385
  const updated = upd(thread.id, {
9355
9386
  sourceType: "orchestration",
9356
9387
  sourceRef: goal
@@ -9563,6 +9594,8 @@ export {
9563
9594
  discoverSkills,
9564
9595
  readSkillBody,
9565
9596
  expandComposerPrompt,
9597
+ consumeComposerAttachments,
9598
+ takePendingTurnAttachments,
9566
9599
  packagedDetachedJobPath,
9567
9600
  resolveDetachedJobScript,
9568
9601
  formatDetachedJobInvoke,
@@ -14,6 +14,7 @@ import {
14
14
  applyAgentEvent,
15
15
  applyAgentRunnerHeapEnv,
16
16
  applyTurnUsage,
17
+ clipAgentEventForPaint,
17
18
  clipToolResultForStore,
18
19
  contextTokens,
19
20
  fallbackTurnFailDetail,
@@ -44,7 +45,7 @@ import {
44
45
  summarizeTurnStderr,
45
46
  toolDescription,
46
47
  turnFailChatText
47
- } from "./chunk-ZU7R35NY.js";
48
+ } from "./chunk-7PEIIN7P.js";
48
49
  import {
49
50
  SLACK_REPLY_FORMATTING,
50
51
  addWorkspace,
@@ -67,7 +68,7 @@ import {
67
68
  stageAbsolutePathsAsAttachments,
68
69
  stageBuffersAsAttachments,
69
70
  syncWorkspacesFromThreads
70
- } from "./chunk-QOJB5PC7.js";
71
+ } from "./chunk-DNTPX6HV.js";
71
72
  import {
72
73
  addPrStackLayer,
73
74
  allocateTeamName,
@@ -117,7 +118,7 @@ import {
117
118
  worktreeDisplayLabelForGroup,
118
119
  worktreeNameFromPath,
119
120
  worktreeSlugForTicket
120
- } from "./chunk-N4A4NWFO.js";
121
+ } from "./chunk-NJ2CCLV6.js";
121
122
  import {
122
123
  ATTACHMENTS_DIR,
123
124
  DETACHED_JOBS_DIR,
@@ -135,7 +136,7 @@ import {
135
136
  updateThread,
136
137
  withThreadLock,
137
138
  writeThread
138
- } from "./chunk-DWGEBZ3C.js";
139
+ } from "./chunk-ZHCB4CKR.js";
139
140
  import {
140
141
  ensureWorktreeSideboardIgnored
141
142
  } from "./chunk-SYFVUF2C.js";
@@ -409,7 +410,7 @@ async function continueSourceThread(threadId, prompt) {
409
410
  await continueOnReply(threadId, prompt);
410
411
  return;
411
412
  }
412
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-7WF32ZXJ.js");
413
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-4IGHVRAF.js");
413
414
  await getOrchestrator2().send(threadId, prompt);
414
415
  } catch {
415
416
  }
@@ -802,9 +803,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
802
803
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
803
804
  );
804
805
  }
805
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-I2X6UQMX.js");
806
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-V6G2KH2V.js");
806
807
  if (isGlobalThread2(thread)) {
807
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-6NV2IHEX.js");
808
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-TUHB6ZFA.js");
808
809
  ensureGlobalCoordinatorCwd2(
809
810
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
810
811
  );
@@ -4242,7 +4243,7 @@ async function adoptThread(input) {
4242
4243
  messages: input.messages ?? []
4243
4244
  });
4244
4245
  writeThread(thread);
4245
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-CEU25ANO.js");
4246
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-CLNANACI.js");
4246
4247
  await ensureWorkspace2(repoPath);
4247
4248
  const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-N5X5I422.js");
4248
4249
  await ensureWorktreeSideboardIgnored2(input.worktreePath);
@@ -5987,6 +5988,28 @@ function expandComposerPrompt(worktreePath, prompt, opts) {
5987
5988
  };
5988
5989
  }
5989
5990
 
5991
+ // src/composer/consume-attachments.ts
5992
+ function consumeComposerAttachments(thread) {
5993
+ if (thread.attachments.length === 0) {
5994
+ return {
5995
+ attachments: [],
5996
+ pendingTurnAttachments: thread.pendingTurnAttachments ?? []
5997
+ };
5998
+ }
5999
+ return {
6000
+ attachments: [],
6001
+ pendingTurnAttachments: [
6002
+ ...thread.pendingTurnAttachments ?? [],
6003
+ ...thread.attachments
6004
+ ]
6005
+ };
6006
+ }
6007
+ function takePendingTurnAttachments(thread) {
6008
+ const pending = thread.pendingTurnAttachments ?? [];
6009
+ if (pending.length === 0 && thread.attachments.length === 0) return [];
6010
+ return [...pending, ...thread.attachments];
6011
+ }
6012
+
5990
6013
  // src/agents/instructions.ts
5991
6014
  import { existsSync as existsSync17 } from "fs";
5992
6015
  import { join as join16 } from "path";
@@ -6620,7 +6643,7 @@ function formatScheduledPrompt(name, prompt) {
6620
6643
  ${prompt}`;
6621
6644
  }
6622
6645
  async function defaultDeps() {
6623
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-7WF32ZXJ.js");
6646
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-4IGHVRAF.js");
6624
6647
  const orch = getOrchestrator2();
6625
6648
  return {
6626
6649
  findThread: (id) => findThreadByRef(id),
@@ -7243,6 +7266,11 @@ var Orchestrator = class {
7243
7266
  const inFlight = this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id) || current.status === "running";
7244
7267
  shouldSteer = followUp === "steer" && (inFlight || current.queue.length > 0);
7245
7268
  const patch = { queue };
7269
+ if (current.attachments.length > 0) {
7270
+ const consumed = consumeComposerAttachments(current);
7271
+ patch.attachments = consumed.attachments;
7272
+ patch.pendingTurnAttachments = consumed.pendingTurnAttachments;
7273
+ }
7246
7274
  if (!inFlight) patch.status = "queued";
7247
7275
  const pid = current.agentPid;
7248
7276
  if (typeof pid === "number" && pid > 0 && !isPidAlive(pid)) {
@@ -7423,7 +7451,8 @@ var Orchestrator = class {
7423
7451
  thread = this.requireThread(threadId);
7424
7452
  }
7425
7453
  const autoContinue = isJobContinuePrompt(prompt) || prompt.trim().startsWith("The previous agent process ended before it finished.");
7426
- const sentAttachments = !autoContinue && thread.attachments.length > 0 ? [...thread.attachments] : void 0;
7454
+ const parked = takePendingTurnAttachments(thread);
7455
+ const sentAttachments = !autoContinue && parked.length > 0 ? parked : void 0;
7427
7456
  appendMessage(threadId, {
7428
7457
  role: "user",
7429
7458
  text: prompt,
@@ -7490,8 +7519,8 @@ var Orchestrator = class {
7490
7519
  slackReplyContext,
7491
7520
  expandedPrompt
7492
7521
  ].filter(Boolean).join("\n\n");
7493
- if (!autoContinue && thread.attachments.length > 0) {
7494
- updateThread(threadId, { attachments: [] });
7522
+ if (!autoContinue && sentAttachments) {
7523
+ updateThread(threadId, { attachments: [], pendingTurnAttachments: [] });
7495
7524
  }
7496
7525
  const adapter = getAdapter(thread.agent);
7497
7526
  const resolved = await adapter.resolveSessionId(thread.worktreePath, thread.sessionId);
@@ -7597,8 +7626,9 @@ var Orchestrator = class {
7597
7626
  isolateCodexPlugins: fresh.isolateCodexPlugins === true
7598
7627
  },
7599
7628
  (event) => {
7600
- this.emit({ type: "turn_output", threadId, event });
7601
- noteTurnLiveEvent(threadId, event);
7629
+ const paint = clipAgentEventForPaint(event);
7630
+ this.emit({ type: "turn_output", threadId, event: paint });
7631
+ noteTurnLiveEvent(threadId, paint);
7602
7632
  if (event.type === "session_id") {
7603
7633
  updateThread(threadId, { sessionId: event.data });
7604
7634
  }
@@ -7723,7 +7753,8 @@ var Orchestrator = class {
7723
7753
  isolateCodexPlugins: isolateCodexPluginRetry || retryThread.isolateCodexPlugins === true
7724
7754
  },
7725
7755
  (event) => {
7726
- this.emit({ type: "turn_output", threadId, event });
7756
+ const paint = clipAgentEventForPaint(event);
7757
+ this.emit({ type: "turn_output", threadId, event: paint });
7727
7758
  if (event.type === "session_id") {
7728
7759
  updateThread(threadId, { sessionId: event.data });
7729
7760
  }
@@ -8799,7 +8830,7 @@ var Orchestrator = class {
8799
8830
  this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
8800
8831
  if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
8801
8832
  try {
8802
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-CEU25ANO.js");
8833
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-CLNANACI.js");
8803
8834
  await ensureWorkspace2(thread.repoPath);
8804
8835
  } catch {
8805
8836
  }
@@ -8853,7 +8884,7 @@ var Orchestrator = class {
8853
8884
  `Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
8854
8885
  );
8855
8886
  }
8856
- const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-YD7Y6NRY.js");
8887
+ const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-JKTM47K5.js");
8857
8888
  const slug = thread.worktreePath.split("/").pop();
8858
8889
  const dest = thread.worktreePath;
8859
8890
  await withRepoGitLock(thread.repoPath, async () => {
@@ -8963,7 +8994,7 @@ async function startOrchestration(opts) {
8963
8994
  sourceRef: "default",
8964
8995
  ...createOpts
8965
8996
  }).catch(async () => {
8966
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-YD7Y6NRY.js");
8997
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-JKTM47K5.js");
8967
8998
  const repo = await resolveRepoRoot2(repoPath);
8968
8999
  const def = await resolveDefaultBranch2(repo);
8969
9000
  return orch.createThread({
@@ -8973,7 +9004,7 @@ async function startOrchestration(opts) {
8973
9004
  repoPath: repo
8974
9005
  });
8975
9006
  });
8976
- const { updateThread: upd } = await import("./thread-store-LS2T6RVH.js");
9007
+ const { updateThread: upd } = await import("./thread-store-FMWDFAO5.js");
8977
9008
  const updated = upd(thread.id, {
8978
9009
  sourceType: "orchestration",
8979
9010
  sourceRef: goal
@@ -7,7 +7,7 @@ import {
7
7
  resolveRepoRoot,
8
8
  takenSlugsFromThread,
9
9
  teamSlugFromName
10
- } from "./chunk-N4A4NWFO.js";
10
+ } from "./chunk-NJ2CCLV6.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-DWGEBZ3C.js";
20
+ } from "./chunk-ZHCB4CKR.js";
21
21
  import {
22
22
  assertOrchestratorCapableAgent,
23
23
  formatAccountProfilePlaybookLine,
@@ -5,7 +5,7 @@ import {
5
5
  resolveRepoRoot,
6
6
  takenSlugsFromThread,
7
7
  teamSlugFromName
8
- } from "./chunk-6KH4OBEW.js";
8
+ } from "./chunk-OP6CFVTB.js";
9
9
  import {
10
10
  ATTACHMENTS_DIR,
11
11
  attachmentsGitignoreBody
@@ -28,7 +28,7 @@ import {
28
28
  listThreads,
29
29
  updateThread,
30
30
  writeThread
31
- } from "./chunk-ARR4OGLY.js";
31
+ } from "./chunk-7DKX5JLT.js";
32
32
  import {
33
33
  appDataDir,
34
34
  globalAgentCwd,
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-D6JWYJ4P.js";
6
6
  import {
7
7
  listThreads
8
- } from "./chunk-DWGEBZ3C.js";
8
+ } from "./chunk-ZHCB4CKR.js";
9
9
  import {
10
10
  ensureWorktreeSideboardIgnored
11
11
  } from "./chunk-SYFVUF2C.js";
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-Y4CF7LHH.js";
11
11
  import {
12
12
  listThreads
13
- } from "./chunk-ARR4OGLY.js";
13
+ } from "./chunk-7DKX5JLT.js";
14
14
  import {
15
15
  worktreesRoot
16
16
  } from "./chunk-WFUDY6PC.js";
@@ -43,6 +43,7 @@ function normalizeThread(raw) {
43
43
  lastError: raw.lastError ?? null,
44
44
  agentPid: raw.agentPid ?? null,
45
45
  attachments: Array.isArray(raw.attachments) ? raw.attachments : [],
46
+ pendingTurnAttachments: Array.isArray(raw.pendingTurnAttachments) ? raw.pendingTurnAttachments : [],
46
47
  prTitle: raw.prTitle ?? null,
47
48
  prState: raw.prState ?? null,
48
49
  prIsDraft: Boolean(raw.prIsDraft),
@@ -85,6 +86,7 @@ function createEmptyThread(partial) {
85
86
  userSetTitle: partial.userSetTitle ?? false,
86
87
  messages: partial.messages ?? [],
87
88
  attachments: partial.attachments ?? [],
89
+ pendingTurnAttachments: partial.pendingTurnAttachments ?? [],
88
90
  createdAt: ts,
89
91
  updatedAt: ts,
90
92
  title: partial.title,