@sideboard-ai/core 0.1.211 → 0.1.212

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.
@@ -483,7 +483,7 @@ async function continueSourceThread(threadId, prompt) {
483
483
  await continueOnReply(threadId, prompt);
484
484
  return;
485
485
  }
486
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-QMGH4V4K.js");
486
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-333M3JAU.js");
487
487
  await getOrchestrator2().send(threadId, prompt);
488
488
  } catch {
489
489
  }
@@ -6251,9 +6251,7 @@ function consumeComposerAttachments(thread) {
6251
6251
  };
6252
6252
  }
6253
6253
  function takePendingTurnAttachments(thread) {
6254
- const pending = thread.pendingTurnAttachments ?? [];
6255
- if (pending.length > 0) return [...pending];
6256
- return thread.attachments.length > 0 ? [...thread.attachments] : [];
6254
+ return [...thread.pendingTurnAttachments ?? []];
6257
6255
  }
6258
6256
  function alignQueueAttachments(queueLength, existing) {
6259
6257
  const next = (existing ?? []).slice(0, queueLength).map((slot) => [...slot ?? []]);
@@ -7123,7 +7121,7 @@ function formatScheduledPrompt(name, prompt) {
7123
7121
  ${prompt}`;
7124
7122
  }
7125
7123
  async function defaultDeps() {
7126
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-QMGH4V4K.js");
7124
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-333M3JAU.js");
7127
7125
  const orch = getOrchestrator2();
7128
7126
  return {
7129
7127
  findThread: (id) => findThreadByRef(id),
@@ -7814,9 +7812,11 @@ var Orchestrator = class {
7814
7812
  const inFlight = this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id);
7815
7813
  updateThread(thread.id, {
7816
7814
  ...removed,
7817
- // Old sends parked on pendingTurnAttachments; drop that bag when the
7818
- // follow-up that owned it is gone so a later turn cannot inherit it.
7819
- ...stillQueued ? {} : { pendingTurnAttachments: [] },
7815
+ // Follow-up files live on queueAttachments. pendingTurnAttachments is
7816
+ // the in-flight / just-dequeued snapshot — do not wipe it when a
7817
+ // later follow-up is removed. Only drop a leftover bag when nothing
7818
+ // is running and the queue is empty (legacy sends that never drained).
7819
+ ...stillQueued || inFlight ? {} : { pendingTurnAttachments: [] },
7820
7820
  status: !stillQueued && !inFlight && current.status === "queued" ? "idle" : current.status
7821
7821
  });
7822
7822
  this.emit({ type: "queue_changed", threadId: thread.id, queue: removed.queue });
@@ -7898,7 +7898,9 @@ var Orchestrator = class {
7898
7898
  updateThread(threadId, {
7899
7899
  queue: shifted.queue,
7900
7900
  queueAttachments: shifted.queueAttachments,
7901
- ...shifted.attachments.length > 0 ? { pendingTurnAttachments: shifted.attachments } : {}
7901
+ // Always write the snapshot, including [] for text-only, so
7902
+ // takePending cannot fall back to leftover pending or composer files.
7903
+ pendingTurnAttachments: shifted.attachments
7902
7904
  });
7903
7905
  this.emit({ type: "queue_changed", threadId, queue: shifted.queue });
7904
7906
  await this.runTurn(threadId, shifted.prompt);
@@ -7946,7 +7948,6 @@ var Orchestrator = class {
7946
7948
  thread = this.requireThread(threadId);
7947
7949
  }
7948
7950
  const autoContinue = isJobContinuePrompt(prompt) || prompt.trim().startsWith("The previous agent process ended before it finished.");
7949
- const parkedSnapshot = thread.pendingTurnAttachments ?? [];
7950
7951
  const parked = takePendingTurnAttachments(thread);
7951
7952
  const sentAttachments = !autoContinue && parked.length > 0 ? parked : void 0;
7952
7953
  appendMessage(threadId, {
@@ -7962,7 +7963,7 @@ var Orchestrator = class {
7962
7963
  thread.worktreePath,
7963
7964
  gitPrompt,
7964
7965
  {
7965
- attachments: autoContinue ? [] : sentAttachments ?? thread.attachments
7966
+ attachments: autoContinue ? [] : sentAttachments ?? []
7966
7967
  }
7967
7968
  );
7968
7969
  const slackInbound = /^(Slack DM|Slack @mention)(?:\n|$)/.test(
@@ -8016,10 +8017,7 @@ var Orchestrator = class {
8016
8017
  expandedPrompt
8017
8018
  ].filter(Boolean).join("\n\n");
8018
8019
  if (!autoContinue && sentAttachments) {
8019
- updateThread(
8020
- threadId,
8021
- parkedSnapshot.length > 0 ? { pendingTurnAttachments: [] } : { attachments: [], pendingTurnAttachments: [] }
8022
- );
8020
+ updateThread(threadId, { pendingTurnAttachments: [] });
8023
8021
  }
8024
8022
  const adapter = getAdapter(thread.agent);
8025
8023
  const resolved = await adapter.resolveSessionId(thread.worktreePath, thread.sessionId);
@@ -417,7 +417,7 @@ async function continueSourceThread(threadId, prompt) {
417
417
  await continueOnReply(threadId, prompt);
418
418
  return;
419
419
  }
420
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-NZO4PVFH.js");
420
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-DW4HDWLA.js");
421
421
  await getOrchestrator2().send(threadId, prompt);
422
422
  } catch {
423
423
  }
@@ -6067,9 +6067,7 @@ function consumeComposerAttachments(thread) {
6067
6067
  };
6068
6068
  }
6069
6069
  function takePendingTurnAttachments(thread) {
6070
- const pending = thread.pendingTurnAttachments ?? [];
6071
- if (pending.length > 0) return [...pending];
6072
- return thread.attachments.length > 0 ? [...thread.attachments] : [];
6070
+ return [...thread.pendingTurnAttachments ?? []];
6073
6071
  }
6074
6072
  function alignQueueAttachments(queueLength, existing) {
6075
6073
  const next = (existing ?? []).slice(0, queueLength).map((slot) => [...slot ?? []]);
@@ -6746,7 +6744,7 @@ function formatScheduledPrompt(name, prompt) {
6746
6744
  ${prompt}`;
6747
6745
  }
6748
6746
  async function defaultDeps() {
6749
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-NZO4PVFH.js");
6747
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-DW4HDWLA.js");
6750
6748
  const orch = getOrchestrator2();
6751
6749
  return {
6752
6750
  findThread: (id) => findThreadByRef(id),
@@ -7437,9 +7435,11 @@ var Orchestrator = class {
7437
7435
  const inFlight = this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id);
7438
7436
  updateThread(thread.id, {
7439
7437
  ...removed,
7440
- // Old sends parked on pendingTurnAttachments; drop that bag when the
7441
- // follow-up that owned it is gone so a later turn cannot inherit it.
7442
- ...stillQueued ? {} : { pendingTurnAttachments: [] },
7438
+ // Follow-up files live on queueAttachments. pendingTurnAttachments is
7439
+ // the in-flight / just-dequeued snapshot — do not wipe it when a
7440
+ // later follow-up is removed. Only drop a leftover bag when nothing
7441
+ // is running and the queue is empty (legacy sends that never drained).
7442
+ ...stillQueued || inFlight ? {} : { pendingTurnAttachments: [] },
7443
7443
  status: !stillQueued && !inFlight && current.status === "queued" ? "idle" : current.status
7444
7444
  });
7445
7445
  this.emit({ type: "queue_changed", threadId: thread.id, queue: removed.queue });
@@ -7521,7 +7521,9 @@ var Orchestrator = class {
7521
7521
  updateThread(threadId, {
7522
7522
  queue: shifted.queue,
7523
7523
  queueAttachments: shifted.queueAttachments,
7524
- ...shifted.attachments.length > 0 ? { pendingTurnAttachments: shifted.attachments } : {}
7524
+ // Always write the snapshot, including [] for text-only, so
7525
+ // takePending cannot fall back to leftover pending or composer files.
7526
+ pendingTurnAttachments: shifted.attachments
7525
7527
  });
7526
7528
  this.emit({ type: "queue_changed", threadId, queue: shifted.queue });
7527
7529
  await this.runTurn(threadId, shifted.prompt);
@@ -7569,7 +7571,6 @@ var Orchestrator = class {
7569
7571
  thread = this.requireThread(threadId);
7570
7572
  }
7571
7573
  const autoContinue = isJobContinuePrompt(prompt) || prompt.trim().startsWith("The previous agent process ended before it finished.");
7572
- const parkedSnapshot = thread.pendingTurnAttachments ?? [];
7573
7574
  const parked = takePendingTurnAttachments(thread);
7574
7575
  const sentAttachments = !autoContinue && parked.length > 0 ? parked : void 0;
7575
7576
  appendMessage(threadId, {
@@ -7585,7 +7586,7 @@ var Orchestrator = class {
7585
7586
  thread.worktreePath,
7586
7587
  gitPrompt,
7587
7588
  {
7588
- attachments: autoContinue ? [] : sentAttachments ?? thread.attachments
7589
+ attachments: autoContinue ? [] : sentAttachments ?? []
7589
7590
  }
7590
7591
  );
7591
7592
  const slackInbound = /^(Slack DM|Slack @mention)(?:\n|$)/.test(
@@ -7639,10 +7640,7 @@ var Orchestrator = class {
7639
7640
  expandedPrompt
7640
7641
  ].filter(Boolean).join("\n\n");
7641
7642
  if (!autoContinue && sentAttachments) {
7642
- updateThread(
7643
- threadId,
7644
- parkedSnapshot.length > 0 ? { pendingTurnAttachments: [] } : { attachments: [], pendingTurnAttachments: [] }
7645
- );
7643
+ updateThread(threadId, { pendingTurnAttachments: [] });
7646
7644
  }
7647
7645
  const adapter = getAdapter(thread.agent);
7648
7646
  const resolved = await adapter.resolveSessionId(thread.worktreePath, thread.sessionId);
package/dist/index.cjs CHANGED
@@ -21901,9 +21901,7 @@ function consumeComposerAttachments(thread) {
21901
21901
  };
21902
21902
  }
21903
21903
  function takePendingTurnAttachments(thread) {
21904
- const pending = thread.pendingTurnAttachments ?? [];
21905
- if (pending.length > 0) return [...pending];
21906
- return thread.attachments.length > 0 ? [...thread.attachments] : [];
21904
+ return [...thread.pendingTurnAttachments ?? []];
21907
21905
  }
21908
21906
  function alignQueueAttachments(queueLength, existing) {
21909
21907
  const next = (existing ?? []).slice(0, queueLength).map((slot) => [...slot ?? []]);
@@ -23492,9 +23490,11 @@ var init_orchestrator = __esm({
23492
23490
  const inFlight = this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id);
23493
23491
  updateThread(thread.id, {
23494
23492
  ...removed,
23495
- // Old sends parked on pendingTurnAttachments; drop that bag when the
23496
- // follow-up that owned it is gone so a later turn cannot inherit it.
23497
- ...stillQueued ? {} : { pendingTurnAttachments: [] },
23493
+ // Follow-up files live on queueAttachments. pendingTurnAttachments is
23494
+ // the in-flight / just-dequeued snapshot — do not wipe it when a
23495
+ // later follow-up is removed. Only drop a leftover bag when nothing
23496
+ // is running and the queue is empty (legacy sends that never drained).
23497
+ ...stillQueued || inFlight ? {} : { pendingTurnAttachments: [] },
23498
23498
  status: !stillQueued && !inFlight && current.status === "queued" ? "idle" : current.status
23499
23499
  });
23500
23500
  this.emit({ type: "queue_changed", threadId: thread.id, queue: removed.queue });
@@ -23576,7 +23576,9 @@ var init_orchestrator = __esm({
23576
23576
  updateThread(threadId, {
23577
23577
  queue: shifted.queue,
23578
23578
  queueAttachments: shifted.queueAttachments,
23579
- ...shifted.attachments.length > 0 ? { pendingTurnAttachments: shifted.attachments } : {}
23579
+ // Always write the snapshot, including [] for text-only, so
23580
+ // takePending cannot fall back to leftover pending or composer files.
23581
+ pendingTurnAttachments: shifted.attachments
23580
23582
  });
23581
23583
  this.emit({ type: "queue_changed", threadId, queue: shifted.queue });
23582
23584
  await this.runTurn(threadId, shifted.prompt);
@@ -23624,7 +23626,6 @@ var init_orchestrator = __esm({
23624
23626
  thread = this.requireThread(threadId);
23625
23627
  }
23626
23628
  const autoContinue = isJobContinuePrompt(prompt) || prompt.trim().startsWith("The previous agent process ended before it finished.");
23627
- const parkedSnapshot = thread.pendingTurnAttachments ?? [];
23628
23629
  const parked = takePendingTurnAttachments(thread);
23629
23630
  const sentAttachments = !autoContinue && parked.length > 0 ? parked : void 0;
23630
23631
  appendMessage(threadId, {
@@ -23640,7 +23641,7 @@ var init_orchestrator = __esm({
23640
23641
  thread.worktreePath,
23641
23642
  gitPrompt,
23642
23643
  {
23643
- attachments: autoContinue ? [] : sentAttachments ?? thread.attachments
23644
+ attachments: autoContinue ? [] : sentAttachments ?? []
23644
23645
  }
23645
23646
  );
23646
23647
  const slackInbound = /^(Slack DM|Slack @mention)(?:\n|$)/.test(
@@ -23694,10 +23695,7 @@ var init_orchestrator = __esm({
23694
23695
  expandedPrompt
23695
23696
  ].filter(Boolean).join("\n\n");
23696
23697
  if (!autoContinue && sentAttachments) {
23697
- updateThread(
23698
- threadId,
23699
- parkedSnapshot.length > 0 ? { pendingTurnAttachments: [] } : { attachments: [], pendingTurnAttachments: [] }
23700
- );
23698
+ updateThread(threadId, { pendingTurnAttachments: [] });
23701
23699
  }
23702
23700
  const adapter = getAdapter(thread.agent);
23703
23701
  const resolved = await adapter.resolveSessionId(thread.worktreePath, thread.sessionId);
package/dist/index.d.cts CHANGED
@@ -4194,11 +4194,10 @@ declare function consumeComposerAttachments(thread: {
4194
4194
  };
4195
4195
  /**
4196
4196
  * Attachments the next non-continue turn should send, then drop.
4197
- * A parked send snapshot wins. Leftover composer files arrived after send
4198
- * and belong to the next message — do not steal them.
4197
+ * Only the parked send snapshot counts. Leftover composer files arrived
4198
+ * after send and belong to the next message — do not steal them.
4199
4199
  */
4200
4200
  declare function takePendingTurnAttachments(thread: {
4201
- attachments: ThreadAttachment[];
4202
4201
  pendingTurnAttachments?: ThreadAttachment[];
4203
4202
  }): ThreadAttachment[];
4204
4203
  /** Keep `queueAttachments` the same length as `queue`. Missing slots are empty. */
package/dist/index.d.ts CHANGED
@@ -4194,11 +4194,10 @@ declare function consumeComposerAttachments(thread: {
4194
4194
  };
4195
4195
  /**
4196
4196
  * Attachments the next non-continue turn should send, then drop.
4197
- * A parked send snapshot wins. Leftover composer files arrived after send
4198
- * and belong to the next message — do not steal them.
4197
+ * Only the parked send snapshot counts. Leftover composer files arrived
4198
+ * after send and belong to the next message — do not steal them.
4199
4199
  */
4200
4200
  declare function takePendingTurnAttachments(thread: {
4201
- attachments: ThreadAttachment[];
4202
4201
  pendingTurnAttachments?: ThreadAttachment[];
4203
4202
  }): ThreadAttachment[];
4204
4203
  /** Keep `queueAttachments` the same length as `queue`. Missing slots are empty. */
package/dist/index.js CHANGED
@@ -315,7 +315,7 @@ import {
315
315
  worktreeCleanupSettings,
316
316
  wrapReviewSkillMarkdown,
317
317
  writeWorktreeFile
318
- } from "./chunk-KZUA4QG2.js";
318
+ } from "./chunk-DINKOGEU.js";
319
319
  import {
320
320
  LEGACY_PLAN_FILE_REL,
321
321
  PLAN_FILE_NAME,
@@ -19781,9 +19781,7 @@ function consumeComposerAttachments(thread) {
19781
19781
  };
19782
19782
  }
19783
19783
  function takePendingTurnAttachments(thread) {
19784
- const pending = thread.pendingTurnAttachments ?? [];
19785
- if (pending.length > 0) return [...pending];
19786
- return thread.attachments.length > 0 ? [...thread.attachments] : [];
19784
+ return [...thread.pendingTurnAttachments ?? []];
19787
19785
  }
19788
19786
  function alignQueueAttachments(queueLength, existing) {
19789
19787
  const next = (existing ?? []).slice(0, queueLength).map((slot) => [...slot ?? []]);
@@ -21720,9 +21718,11 @@ var init_orchestrator = __esm({
21720
21718
  const inFlight = this.activeTurns.has(thread.id) || this.startingTurns.has(thread.id);
21721
21719
  updateThread(thread.id, {
21722
21720
  ...removed,
21723
- // Old sends parked on pendingTurnAttachments; drop that bag when the
21724
- // follow-up that owned it is gone so a later turn cannot inherit it.
21725
- ...stillQueued ? {} : { pendingTurnAttachments: [] },
21721
+ // Follow-up files live on queueAttachments. pendingTurnAttachments is
21722
+ // the in-flight / just-dequeued snapshot — do not wipe it when a
21723
+ // later follow-up is removed. Only drop a leftover bag when nothing
21724
+ // is running and the queue is empty (legacy sends that never drained).
21725
+ ...stillQueued || inFlight ? {} : { pendingTurnAttachments: [] },
21726
21726
  status: !stillQueued && !inFlight && current.status === "queued" ? "idle" : current.status
21727
21727
  });
21728
21728
  this.emit({ type: "queue_changed", threadId: thread.id, queue: removed.queue });
@@ -21804,7 +21804,9 @@ var init_orchestrator = __esm({
21804
21804
  updateThread(threadId, {
21805
21805
  queue: shifted.queue,
21806
21806
  queueAttachments: shifted.queueAttachments,
21807
- ...shifted.attachments.length > 0 ? { pendingTurnAttachments: shifted.attachments } : {}
21807
+ // Always write the snapshot, including [] for text-only, so
21808
+ // takePending cannot fall back to leftover pending or composer files.
21809
+ pendingTurnAttachments: shifted.attachments
21808
21810
  });
21809
21811
  this.emit({ type: "queue_changed", threadId, queue: shifted.queue });
21810
21812
  await this.runTurn(threadId, shifted.prompt);
@@ -21852,7 +21854,6 @@ var init_orchestrator = __esm({
21852
21854
  thread = this.requireThread(threadId);
21853
21855
  }
21854
21856
  const autoContinue = isJobContinuePrompt(prompt) || prompt.trim().startsWith("The previous agent process ended before it finished.");
21855
- const parkedSnapshot = thread.pendingTurnAttachments ?? [];
21856
21857
  const parked = takePendingTurnAttachments(thread);
21857
21858
  const sentAttachments = !autoContinue && parked.length > 0 ? parked : void 0;
21858
21859
  appendMessage(threadId, {
@@ -21868,7 +21869,7 @@ var init_orchestrator = __esm({
21868
21869
  thread.worktreePath,
21869
21870
  gitPrompt,
21870
21871
  {
21871
- attachments: autoContinue ? [] : sentAttachments ?? thread.attachments
21872
+ attachments: autoContinue ? [] : sentAttachments ?? []
21872
21873
  }
21873
21874
  );
21874
21875
  const slackInbound = /^(Slack DM|Slack @mention)(?:\n|$)/.test(
@@ -21922,10 +21923,7 @@ var init_orchestrator = __esm({
21922
21923
  expandedPrompt
21923
21924
  ].filter(Boolean).join("\n\n");
21924
21925
  if (!autoContinue && sentAttachments) {
21925
- updateThread(
21926
- threadId,
21927
- parkedSnapshot.length > 0 ? { pendingTurnAttachments: [] } : { attachments: [], pendingTurnAttachments: [] }
21928
- );
21926
+ updateThread(threadId, { pendingTurnAttachments: [] });
21929
21927
  }
21930
21928
  const adapter = getAdapter(thread.agent);
21931
21929
  const resolved = await adapter.resolveSessionId(thread.worktreePath, thread.sessionId);
@@ -50,7 +50,7 @@ import {
50
50
  syncBoardPins,
51
51
  updateSchedule,
52
52
  waitForDetachedJob
53
- } from "../chunk-ERNK7AWM.js";
53
+ } from "../chunk-MS6HGW2H.js";
54
54
  import "../chunk-JFOPOMK7.js";
55
55
  import "../chunk-YWI3IBP2.js";
56
56
  import {
@@ -7,7 +7,7 @@ import {
7
7
  resolveSendFollowUp,
8
8
  startOrchestration,
9
9
  waitForPidExit
10
- } from "./chunk-KZUA4QG2.js";
10
+ } from "./chunk-DINKOGEU.js";
11
11
  import "./chunk-DJU54RYW.js";
12
12
  import "./chunk-IRCAWYTN.js";
13
13
  import "./chunk-2PE6SZCM.js";
@@ -9,7 +9,7 @@ import {
9
9
  resolveSendFollowUp,
10
10
  startOrchestration,
11
11
  waitForPidExit
12
- } from "./chunk-ERNK7AWM.js";
12
+ } from "./chunk-MS6HGW2H.js";
13
13
  import "./chunk-JFOPOMK7.js";
14
14
  import "./chunk-YWI3IBP2.js";
15
15
  import "./chunk-IA5IPGZI.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sideboard-ai/core",
3
- "version": "0.1.211",
3
+ "version": "0.1.212",
4
4
  "description": "Sideboard core — orchestration, agents, git worktrees, MCP server",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",