@sideboard-ai/core 0.1.198 → 0.1.200

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 (35) hide show
  1. package/dist/{abletime-JINF5KJV.js → abletime-345SE3B4.js} +2 -2
  2. package/dist/{abletime-HR6P4GJH.js → abletime-KGPD3UUJ.js} +2 -2
  3. package/dist/{agents-5TZY6LLX.js → agents-N7WXOGN6.js} +28 -4
  4. package/dist/{agents-AQQKPD46.js → agents-ZRIFDXCB.js} +28 -4
  5. package/dist/{app-settings-5KHVKJKO.js → app-settings-AXCURTZJ.js} +11 -1
  6. package/dist/{app-settings-J775CYOO.js → app-settings-V6IHESEQ.js} +11 -1
  7. package/dist/{chunk-SYXSSU7G.js → chunk-5XSDGJMP.js} +369 -4
  8. package/dist/{chunk-DROELG52.js → chunk-62IMZIIZ.js} +58 -41
  9. package/dist/{chunk-E37JHCO3.js → chunk-7AHAABKN.js} +1 -1
  10. package/dist/{chunk-S5GLSRLP.js → chunk-CXFW5LIH.js} +48 -1
  11. package/dist/{chunk-6YTI2HBG.js → chunk-EWDE54OI.js} +2 -2
  12. package/dist/{chunk-AH6WIBLY.js → chunk-ISV5IFH3.js} +48 -1
  13. package/dist/{chunk-DP4TKAMZ.js → chunk-NXM45OS3.js} +1 -1
  14. package/dist/{chunk-6YS5IKD2.js → chunk-O2DRYD2B.js} +59 -42
  15. package/dist/{chunk-S4QCBBXS.js → chunk-OSPE25A7.js} +1 -1
  16. package/dist/{chunk-HZTHWU6A.js → chunk-PDMNYCPL.js} +2 -2
  17. package/dist/{chunk-KTHRWHA3.js → chunk-PGQGP4FD.js} +1 -1
  18. package/dist/{chunk-EA67VQM2.js → chunk-PKUPOVKP.js} +369 -4
  19. package/dist/{coordinator-prompt-IX66YUJ2.js → coordinator-prompt-2RWBH6W7.js} +3 -3
  20. package/dist/{coordinator-prompt-LYKS3YNG.js → coordinator-prompt-AL62H73U.js} +3 -3
  21. package/dist/{global-workspace-SNJ2Z6SL.js → global-workspace-VAO3BQP5.js} +3 -3
  22. package/dist/{global-workspace-4QX6UEOY.js → global-workspace-Y5KKGXN7.js} +3 -3
  23. package/dist/index.cjs +766 -280
  24. package/dist/index.d.cts +116 -11
  25. package/dist/index.d.ts +116 -11
  26. package/dist/index.js +42 -8
  27. package/dist/mcp/run-stdio.cjs +374 -276
  28. package/dist/mcp/run-stdio.js +8 -8
  29. package/dist/{orchestrator-L2H42HPW.js → orchestrator-D2EJ4Z7Z.js} +5 -5
  30. package/dist/{orchestrator-6ZNKCPNL.js → orchestrator-DPHIMK44.js} +5 -5
  31. package/dist/{workspaces-URMUVGAQ.js → workspaces-DZZQM745.js} +3 -3
  32. package/dist/{workspaces-UTOYGBYB.js → workspaces-HEKFQP4B.js} +3 -3
  33. package/dist/{worktree-R43JOR4V.js → worktree-ENRMJUI3.js} +2 -2
  34. package/dist/{worktree-RM6UWNGZ.js → worktree-IEUSQ63V.js} +2 -2
  35. package/package.json +1 -1
@@ -25,7 +25,7 @@ import {
25
25
  stripBrightsyNdjsonNoise,
26
26
  sumUsageList,
27
27
  toolDescription
28
- } from "./chunk-EA67VQM2.js";
28
+ } from "./chunk-PKUPOVKP.js";
29
29
  import {
30
30
  SLACK_REPLY_FORMATTING,
31
31
  addWorkspace,
@@ -48,7 +48,7 @@ import {
48
48
  stageAbsolutePathsAsAttachments,
49
49
  stageBuffersAsAttachments,
50
50
  syncWorkspacesFromThreads
51
- } from "./chunk-HZTHWU6A.js";
51
+ } from "./chunk-PDMNYCPL.js";
52
52
  import {
53
53
  addPrStackLayer,
54
54
  allocateTeamName,
@@ -98,7 +98,7 @@ import {
98
98
  worktreeDisplayLabelForGroup,
99
99
  worktreeNameFromPath,
100
100
  worktreeSlugForTicket
101
- } from "./chunk-S4QCBBXS.js";
101
+ } from "./chunk-OSPE25A7.js";
102
102
  import {
103
103
  ATTACHMENTS_DIR,
104
104
  DETACHED_JOBS_DIR,
@@ -144,7 +144,6 @@ import {
144
144
  isSecureFileEncrypted,
145
145
  loadAppSettings,
146
146
  orchestrationQuotaFallbackAgent,
147
- orchestrationQuotaOnLimit,
148
147
  readSecureJson,
149
148
  resolveEffectiveIssueSource,
150
149
  resolveNewThreadOptions,
@@ -153,8 +152,9 @@ import {
153
152
  resolveViewerProfileForRepo,
154
153
  saveAppSettings,
155
154
  updateAdvancedSettings,
155
+ usageOnLimit,
156
156
  writeSecureJson
157
- } from "./chunk-S5GLSRLP.js";
157
+ } from "./chunk-CXFW5LIH.js";
158
158
  import {
159
159
  stripNestedElectronEnv
160
160
  } from "./chunk-4TR3HZFT.js";
@@ -473,7 +473,7 @@ async function continueSourceThread(threadId, prompt) {
473
473
  await continueOnReply(threadId, prompt);
474
474
  return;
475
475
  }
476
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-6ZNKCPNL.js");
476
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-DPHIMK44.js");
477
477
  await getOrchestrator2().send(threadId, prompt);
478
478
  } catch {
479
479
  }
@@ -807,9 +807,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
807
807
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
808
808
  );
809
809
  }
810
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-4QX6UEOY.js");
810
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-Y5KKGXN7.js");
811
811
  if (isGlobalThread2(thread)) {
812
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-IX66YUJ2.js");
812
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-2RWBH6W7.js");
813
813
  ensureGlobalCoordinatorCwd2(
814
814
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
815
815
  );
@@ -3728,7 +3728,7 @@ async function createThread(input, _onSetupLine) {
3728
3728
  });
3729
3729
  await requireAgent(resolved.agent);
3730
3730
  if (input.cowboy) {
3731
- const { cowboyModeEnabled } = await import("./app-settings-5KHVKJKO.js");
3731
+ const { cowboyModeEnabled } = await import("./app-settings-AXCURTZJ.js");
3732
3732
  if (!cowboyModeEnabled()) {
3733
3733
  throw new Error(
3734
3734
  "Cowboy mode is off. Enable it in Settings \u2192 Advanced."
@@ -3786,7 +3786,7 @@ async function createThread(input, _onSetupLine) {
3786
3786
  let sourceIsFork = false;
3787
3787
  if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
3788
3788
  if (isAbleTimeConnected() && getIssueSource() === "abletime") {
3789
- const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-JINF5KJV.js");
3789
+ const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-345SE3B4.js");
3790
3790
  const task = await ensureAbleTimeTask({
3791
3791
  title: title?.trim() || "Untitled work",
3792
3792
  description: input.prompt?.trim() || void 0
@@ -3888,7 +3888,7 @@ async function createThread(input, _onSetupLine) {
3888
3888
  return readThread(thread.id) ?? thread;
3889
3889
  }
3890
3890
  async function listLinearIssues(agent, repoPath) {
3891
- const { getAdapter: getAdapter2 } = await import("./agents-AQQKPD46.js");
3891
+ const { getAdapter: getAdapter2 } = await import("./agents-ZRIFDXCB.js");
3892
3892
  await requireAgent(agent, { requireLinear: true });
3893
3893
  const adapter = getAdapter2(agent);
3894
3894
  if (!adapter.listLinearIssues) {
@@ -4110,12 +4110,18 @@ async function forkThreadWorktree(input, onSetupLine) {
4110
4110
  // src/orchestrator/quota-failover.ts
4111
4111
  import { randomUUID as randomUUID3 } from "crypto";
4112
4112
  function planOrchestrationQuotaFailover(thread, limitText, opts) {
4113
- if (!isOrchestratorThread(thread)) return null;
4114
4113
  if (!isSessionQuotaLimit(limitText)) return null;
4115
- const onLimit = opts?.onLimit ?? orchestrationQuotaOnLimit();
4114
+ const onLimit = opts?.onLimit ?? usageOnLimit();
4116
4115
  const resumeAt = parseSessionQuotaResetAt(limitText, opts?.now);
4116
+ if (onLimit === "keep_going" || onLimit === "confirm") {
4117
+ return {
4118
+ action: "none",
4119
+ reason: onLimit === "confirm" ? "Settings: confirm with user; no automatic continue." : "Settings: keep going; no automatic continue.",
4120
+ limitText
4121
+ };
4122
+ }
4117
4123
  if (thread.quotaContinuedFromId) {
4118
- if (resumeAt) {
4124
+ if (onLimit === "switch_agent" && resumeAt) {
4119
4125
  return {
4120
4126
  action: "wait_reset",
4121
4127
  reason: "Already continued once; waiting for quota reset instead.",
@@ -4125,7 +4131,7 @@ function planOrchestrationQuotaFailover(thread, limitText, opts) {
4125
4131
  }
4126
4132
  return {
4127
4133
  action: "none",
4128
- reason: "Already continued once; no parseable reset time.",
4134
+ reason: "Already continued once; no further automatic continue.",
4129
4135
  limitText
4130
4136
  };
4131
4137
  }
@@ -4162,8 +4168,19 @@ function buildQuotaHandoffAttachment(from, limitText, fallbackAgent) {
4162
4168
  const text = m.text.trim().replace(/\s+/g, " ").slice(0, 280);
4163
4169
  return text ? `- ${role}: ${text}` : null;
4164
4170
  }).filter(Boolean);
4171
+ const orch = isOrchestratorThread(from);
4172
+ const instructions = orch ? [
4173
+ "- Continue fleet orchestration from this handoff.",
4174
+ "- Prefer Sideboard MCP (list_board, list_threads, get_thread, send_to_thread, \u2026) for live status.",
4175
+ "- Leave model Auto unless there is a specific reason to pin one.",
4176
+ `- Do not wait on the limited ${from.agent} account; keep going on ${fallbackAgent}.`
4177
+ ] : [
4178
+ "- Continue this worktree chat from the handoff.",
4179
+ "- Leave model Auto unless there is a specific reason to pin one.",
4180
+ `- Do not wait on the limited ${from.agent} account; keep going on ${fallbackAgent}.`
4181
+ ];
4165
4182
  const body = [
4166
- `# Orchestration handoff`,
4183
+ `# ${orch ? "Orchestration" : "Chat"} handoff`,
4167
4184
  "",
4168
4185
  `Previous chat: ${from.title} (\`${from.id}\`) on **${from.agent}** hit a session/usage limit.`,
4169
4186
  `Limit: ${limitText.trim()}`,
@@ -4179,23 +4196,20 @@ function buildQuotaHandoffAttachment(from, limitText, fallbackAgent) {
4179
4196
  recent.length ? recent.join("\n") : "(none)",
4180
4197
  "",
4181
4198
  `## Instructions`,
4182
- `- Continue fleet orchestration from this handoff.`,
4183
- `- Prefer Sideboard MCP (list_board, list_threads, get_thread, send_to_thread, \u2026) for live status.`,
4184
- `- Leave model Auto unless there is a specific reason to pin one.`,
4185
- `- Do not wait on the limited ${from.agent} account; keep going on ${fallbackAgent}.`
4199
+ ...instructions
4186
4200
  ].join("\n");
4187
4201
  return {
4188
4202
  id: randomUUID3(),
4189
- name: "Orchestration quota handoff.md",
4203
+ name: orch ? "Orchestration quota handoff.md" : "Quota handoff.md",
4190
4204
  kind: "transcript",
4191
4205
  content: body
4192
4206
  };
4193
4207
  }
4194
4208
  var QUOTA_CONTINUE_PROMPT = (fromAgent, fallback) => [
4195
- `${fromAgent} hit a session/usage limit. Continue this orchestration on ${fallback} using the attached handoff.`,
4196
- "Call list_board or list_threads for live fleet status, then proceed with the goal. Leave model Auto unless needed."
4209
+ `${fromAgent} hit a session/usage limit. Continue this chat on ${fallback} using the attached handoff.`,
4210
+ "Proceed with the goal. Leave model Auto unless needed."
4197
4211
  ].join(" ");
4198
- var QUOTA_RESUME_PROMPT = "Session/usage limit window should have reset. Continue the orchestration from where you left off. Use list_board or list_threads for fleet status.";
4212
+ var QUOTA_RESUME_PROMPT = "Session/usage limit window should have reset. Continue this chat from where you left off.";
4199
4213
  function createQuotaFailoverChat(from, fallbackAgent, limitText) {
4200
4214
  const handoff = buildQuotaHandoffAttachment(from, limitText, fallbackAgent);
4201
4215
  const tab = createChatTab({
@@ -4204,12 +4218,15 @@ function createQuotaFailoverChat(from, fallbackAgent, limitText) {
4204
4218
  model: null,
4205
4219
  attachments: [handoff]
4206
4220
  });
4207
- return updateThread(tab.id, {
4208
- parentThreadId: from.id,
4221
+ const patch = {
4209
4222
  quotaContinuedFromId: from.id,
4210
- sourceRef: from.sourceRef,
4211
- sourceType: "orchestration"
4212
- });
4223
+ sourceRef: from.sourceRef
4224
+ };
4225
+ if (isOrchestratorThread(from)) {
4226
+ patch.parentThreadId = from.id;
4227
+ patch.sourceType = "orchestration";
4228
+ }
4229
+ return updateThread(tab.id, patch);
4213
4230
  }
4214
4231
 
4215
4232
  // src/threads/adopt.ts
@@ -4310,7 +4327,7 @@ async function adoptThread(input) {
4310
4327
  messages: input.messages ?? []
4311
4328
  });
4312
4329
  writeThread(thread);
4313
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-URMUVGAQ.js");
4330
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-DZZQM745.js");
4314
4331
  await ensureWorkspace2(repoPath);
4315
4332
  const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-X54WSOXM.js");
4316
4333
  await ensureWorktreeSideboardIgnored2(input.worktreePath);
@@ -6894,7 +6911,7 @@ function formatScheduledPrompt(name, prompt) {
6894
6911
  ${prompt}`;
6895
6912
  }
6896
6913
  async function defaultDeps() {
6897
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-6ZNKCPNL.js");
6914
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-DPHIMK44.js");
6898
6915
  const orch = getOrchestrator2();
6899
6916
  return {
6900
6917
  findThread: (id) => findThreadByRef(id),
@@ -7169,7 +7186,7 @@ var Orchestrator = class {
7169
7186
  orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
7170
7187
  });
7171
7188
  }
7172
- const { autoCleanupOrphansEnabled } = await import("./app-settings-5KHVKJKO.js");
7189
+ const { autoCleanupOrphansEnabled } = await import("./app-settings-AXCURTZJ.js");
7173
7190
  if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
7174
7191
  await cleanupOrphanWorktrees({ repoPaths });
7175
7192
  }
@@ -7280,8 +7297,8 @@ var Orchestrator = class {
7280
7297
  await this.send(threadId, QUOTA_RESUME_PROMPT);
7281
7298
  }
7282
7299
  /**
7283
- * Host-side continue when an orchestration chat hits a provider session/usage
7284
- * limit (not context size): switch agent (Auto) or wait until reset.
7300
+ * Host-side continue when any chat hits a provider session/usage limit
7301
+ * (not context size): switch agent (Auto) or wait until reset.
7285
7302
  */
7286
7303
  async maybeHandleOrchestrationQuotaFailover(threadId, limitText) {
7287
7304
  const thread = findThreadByRef(threadId);
@@ -7294,7 +7311,7 @@ var Orchestrator = class {
7294
7311
  setStatus(threadId, "idle", null);
7295
7312
  appendMessage(threadId, {
7296
7313
  role: "agent",
7297
- text: `Sideboard will auto-retry this orchestration around ${plan.resumeAt.toLocaleString()} when the session limit resets.`,
7314
+ text: `Sideboard will auto-retry this chat around ${plan.resumeAt.toLocaleString()} when the session limit resets.`,
7298
7315
  ts: (/* @__PURE__ */ new Date()).toISOString()
7299
7316
  });
7300
7317
  this.emit({
@@ -7448,7 +7465,7 @@ var Orchestrator = class {
7448
7465
  }
7449
7466
  await setup;
7450
7467
  if (skipSetup) return;
7451
- const { autoRunAfterSetupEnabled } = await import("./app-settings-5KHVKJKO.js");
7468
+ const { autoRunAfterSetupEnabled } = await import("./app-settings-AXCURTZJ.js");
7452
7469
  if (autoRunAfterSetupEnabled()) {
7453
7470
  try {
7454
7471
  await this.startDev(threadId);
@@ -7772,7 +7789,7 @@ var Orchestrator = class {
7772
7789
  }
7773
7790
  const isBrightsy = fresh.agent === "brightsy";
7774
7791
  const isOrchestration = isOrchestratorThread(fresh);
7775
- const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-5KHVKJKO.js");
7792
+ const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-AXCURTZJ.js");
7776
7793
  const gitAuthMode = getGithubGitAuthMode();
7777
7794
  const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
7778
7795
  githubSlug: await resolveGithubRepoSlug(fresh.worktreePath).catch(
@@ -8757,7 +8774,7 @@ var Orchestrator = class {
8757
8774
  updateThread(thread.id, { title: meta.title });
8758
8775
  }
8759
8776
  }
8760
- const { autoArchiveOnMergeEnabled } = await import("./app-settings-5KHVKJKO.js");
8777
+ const { autoArchiveOnMergeEnabled } = await import("./app-settings-AXCURTZJ.js");
8761
8778
  const latest = this.requireThread(thread.id);
8762
8779
  if (!shouldAutoArchiveOnPrMerge({
8763
8780
  previousPrState: prevState || null,
@@ -9049,7 +9066,7 @@ var Orchestrator = class {
9049
9066
  this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
9050
9067
  if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
9051
9068
  try {
9052
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-URMUVGAQ.js");
9069
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-DZZQM745.js");
9053
9070
  await ensureWorkspace2(thread.repoPath);
9054
9071
  } catch {
9055
9072
  }
@@ -9076,7 +9093,7 @@ var Orchestrator = class {
9076
9093
  await runArchiveScript(thread.repoPath, thread.worktreePath);
9077
9094
  } catch {
9078
9095
  }
9079
- const { deleteBranchOnPurgeEnabled } = await import("./app-settings-5KHVKJKO.js");
9096
+ const { deleteBranchOnPurgeEnabled } = await import("./app-settings-AXCURTZJ.js");
9080
9097
  const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
9081
9098
  await removeWorktree(thread.repoPath, thread.worktreePath, {
9082
9099
  deleteBranch: deleteBranch ? thread.branchName : void 0
@@ -9103,7 +9120,7 @@ var Orchestrator = class {
9103
9120
  `Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
9104
9121
  );
9105
9122
  }
9106
- const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-RM6UWNGZ.js");
9123
+ const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-IEUSQ63V.js");
9107
9124
  const slug = thread.worktreePath.split("/").pop();
9108
9125
  const dest = thread.worktreePath;
9109
9126
  await withRepoGitLock(thread.repoPath, async () => {
@@ -9213,7 +9230,7 @@ async function startOrchestration(opts) {
9213
9230
  sourceRef: "default",
9214
9231
  ...createOpts
9215
9232
  }).catch(async () => {
9216
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-RM6UWNGZ.js");
9233
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-IEUSQ63V.js");
9217
9234
  const repo = await resolveRepoRoot2(repoPath);
9218
9235
  const def = await resolveDefaultBranch2(repo);
9219
9236
  return orch.createThread({
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  getGithubGitAuthMode,
9
9
  getGithubPat
10
- } from "./chunk-S5GLSRLP.js";
10
+ } from "./chunk-CXFW5LIH.js";
11
11
  import {
12
12
  listThreads
13
13
  } from "./chunk-KJBYIIJU.js";
@@ -5,7 +5,7 @@ import {
5
5
  resolveRepoRoot,
6
6
  takenSlugsFromThread,
7
7
  teamSlugFromName
8
- } from "./chunk-S4QCBBXS.js";
8
+ } from "./chunk-OSPE25A7.js";
9
9
  import {
10
10
  ATTACHMENTS_DIR,
11
11
  attachmentsGitignoreBody
@@ -22,7 +22,7 @@ import {
22
22
  resolveThreadDefaults,
23
23
  resolveViewerProfile,
24
24
  resolveViewerProfileForRepo
25
- } from "./chunk-S5GLSRLP.js";
25
+ } from "./chunk-CXFW5LIH.js";
26
26
  import {
27
27
  createEmptyThread,
28
28
  listThreads,
@@ -8,7 +8,7 @@ import {
8
8
  getAbleTimeHost,
9
9
  isAbleTimeConnected,
10
10
  saveAbleTimeConnection
11
- } from "./chunk-AH6WIBLY.js";
11
+ } from "./chunk-ISV5IFH3.js";
12
12
 
13
13
  // src/integrations/abletime-mcp.ts
14
14
  var DEFAULT_ABLETIME_HOST = "https://track.abletime.com";