@sideboard-ai/core 0.1.201 → 0.1.203

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 (44) hide show
  1. package/dist/{abletime-KGPD3UUJ.js → abletime-JFGZBDHH.js} +4 -2
  2. package/dist/{abletime-345SE3B4.js → abletime-SISJEPJ3.js} +4 -2
  3. package/dist/abletime-oauth-7TD5Z2QV.js +265 -0
  4. package/dist/abletime-oauth-OSQYFB3E.js +40 -0
  5. package/dist/abletime-rest-QPJTDLKX.js +25 -0
  6. package/dist/abletime-rest-ZJGWYALM.js +24 -0
  7. package/dist/{agents-KFAGRM46.js → agents-3755WYQM.js} +4 -4
  8. package/dist/{agents-HB6N3XJL.js → agents-ZMWL43SP.js} +4 -4
  9. package/dist/{app-settings-V6IHESEQ.js → app-settings-LGHMNHSP.js} +1 -1
  10. package/dist/{app-settings-AXCURTZJ.js → app-settings-YEPF46IJ.js} +1 -1
  11. package/dist/{chunk-AHPIU2VP.js → chunk-2DVCCLII.js} +97 -64
  12. package/dist/chunk-3PYH2RLA.js +388 -0
  13. package/dist/{chunk-RV3ZKE4Y.js → chunk-5IXJTUST.js} +5 -5
  14. package/dist/chunk-6VEIKW5C.js +390 -0
  15. package/dist/chunk-BFEBFGCS.js +250 -0
  16. package/dist/{chunk-STPZQR5B.js → chunk-CMGRV36E.js} +1 -1
  17. package/dist/{chunk-PGQGP4FD.js → chunk-FZ6IBUKY.js} +36 -218
  18. package/dist/{chunk-7AHAABKN.js → chunk-FZYYEMET.js} +36 -228
  19. package/dist/{chunk-54RSAMBH.js → chunk-LCU6GBZP.js} +2 -2
  20. package/dist/chunk-MHPINQKY.js +260 -0
  21. package/dist/chunk-PJHFNFXA.js +243 -0
  22. package/dist/{chunk-CXFW5LIH.js → chunk-QFBBUFD4.js} +38 -3
  23. package/dist/{chunk-RPX6VDW7.js → chunk-QSEF2YVQ.js} +1 -1
  24. package/dist/{chunk-LJHC62LZ.js → chunk-TNDUTGDV.js} +2 -2
  25. package/dist/{chunk-EXZMNINM.js → chunk-TZNJKZ2A.js} +101 -68
  26. package/dist/{chunk-3TOGAUQT.js → chunk-X2TFUFIS.js} +5 -5
  27. package/dist/{chunk-ISV5IFH3.js → chunk-X743YN5Y.js} +38 -3
  28. package/dist/{coordinator-prompt-TY5FHAXC.js → coordinator-prompt-2B2JA2IE.js} +3 -3
  29. package/dist/{coordinator-prompt-BH4EHFOO.js → coordinator-prompt-U4PEZDAW.js} +3 -3
  30. package/dist/{global-workspace-NLLAPQJI.js → global-workspace-JPJ3FKKY.js} +3 -3
  31. package/dist/{global-workspace-5AZEEQRU.js → global-workspace-PU7ZS3LS.js} +3 -3
  32. package/dist/index.cjs +932 -145
  33. package/dist/index.d.cts +61 -9
  34. package/dist/index.d.ts +61 -9
  35. package/dist/index.js +63 -18
  36. package/dist/mcp/run-stdio.cjs +863 -117
  37. package/dist/mcp/run-stdio.js +22 -20
  38. package/dist/{orchestrator-SWWQQFFD.js → orchestrator-3A6KUTNI.js} +5 -5
  39. package/dist/{orchestrator-47JZUHRC.js → orchestrator-Q33M24ZJ.js} +6 -6
  40. package/dist/{workspaces-RP76JH3J.js → workspaces-IMG7ZRUQ.js} +3 -3
  41. package/dist/{workspaces-PEWYWVHZ.js → workspaces-U6P6DB44.js} +3 -3
  42. package/dist/{worktree-ZQEUKSNE.js → worktree-FL3UIUKQ.js} +2 -2
  43. package/dist/{worktree-72TZWUSH.js → worktree-JSCDJPBU.js} +2 -2
  44. package/package.json +1 -1
@@ -26,7 +26,7 @@ import {
26
26
  stripBrightsyNdjsonNoise,
27
27
  sumUsageList,
28
28
  toolDescription
29
- } from "./chunk-RV3ZKE4Y.js";
29
+ } from "./chunk-5IXJTUST.js";
30
30
  import {
31
31
  SLACK_REPLY_FORMATTING,
32
32
  addWorkspace,
@@ -49,7 +49,7 @@ import {
49
49
  stageAbsolutePathsAsAttachments,
50
50
  stageBuffersAsAttachments,
51
51
  syncWorkspacesFromThreads
52
- } from "./chunk-LJHC62LZ.js";
52
+ } from "./chunk-TNDUTGDV.js";
53
53
  import {
54
54
  addPrStackLayer,
55
55
  allocateTeamName,
@@ -99,7 +99,7 @@ import {
99
99
  worktreeDisplayLabelForGroup,
100
100
  worktreeNameFromPath,
101
101
  worktreeSlugForTicket
102
- } from "./chunk-STPZQR5B.js";
102
+ } from "./chunk-CMGRV36E.js";
103
103
  import {
104
104
  ATTACHMENTS_DIR,
105
105
  DETACHED_JOBS_DIR,
@@ -155,7 +155,7 @@ import {
155
155
  updateAdvancedSettings,
156
156
  usageOnLimit,
157
157
  writeSecureJson
158
- } from "./chunk-CXFW5LIH.js";
158
+ } from "./chunk-QFBBUFD4.js";
159
159
  import {
160
160
  stripNestedElectronEnv
161
161
  } from "./chunk-4TR3HZFT.js";
@@ -474,7 +474,7 @@ async function continueSourceThread(threadId, prompt) {
474
474
  await continueOnReply(threadId, prompt);
475
475
  return;
476
476
  }
477
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-SWWQQFFD.js");
477
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-3A6KUTNI.js");
478
478
  await getOrchestrator2().send(threadId, prompt);
479
479
  } catch {
480
480
  }
@@ -808,9 +808,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
808
808
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
809
809
  );
810
810
  }
811
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-5AZEEQRU.js");
811
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-PU7ZS3LS.js");
812
812
  if (isGlobalThread2(thread)) {
813
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-TY5FHAXC.js");
813
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-2B2JA2IE.js");
814
814
  ensureGlobalCoordinatorCwd2(
815
815
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
816
816
  );
@@ -2718,6 +2718,9 @@ function childHaltNotice(child, status) {
2718
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."
2719
2719
  ].join("\n");
2720
2720
  }
2721
+ function shouldNotifyParentAfterTurnError(opts) {
2722
+ return !opts.quotaFailoverHandled && !opts.crashContinued;
2723
+ }
2721
2724
  function shouldNotifyParentOfChildHalt(opts) {
2722
2725
  if (!isIncompleteChildStatus(opts.status)) return false;
2723
2726
  if (!opts.child.parentThreadId) return false;
@@ -3758,7 +3761,7 @@ async function createThread(input, _onSetupLine) {
3758
3761
  });
3759
3762
  await requireAgent(resolved.agent);
3760
3763
  if (input.cowboy) {
3761
- const { cowboyModeEnabled } = await import("./app-settings-AXCURTZJ.js");
3764
+ const { cowboyModeEnabled } = await import("./app-settings-YEPF46IJ.js");
3762
3765
  if (!cowboyModeEnabled()) {
3763
3766
  throw new Error(
3764
3767
  "Cowboy mode is off. Enable it in Settings \u2192 Advanced."
@@ -3816,7 +3819,7 @@ async function createThread(input, _onSetupLine) {
3816
3819
  let sourceIsFork = false;
3817
3820
  if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
3818
3821
  if (isAbleTimeConnected() && getIssueSource() === "abletime") {
3819
- const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-345SE3B4.js");
3822
+ const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-SISJEPJ3.js");
3820
3823
  const task = await ensureAbleTimeTask({
3821
3824
  title: title?.trim() || "Untitled work",
3822
3825
  description: input.prompt?.trim() || void 0
@@ -3918,7 +3921,7 @@ async function createThread(input, _onSetupLine) {
3918
3921
  return readThread(thread.id) ?? thread;
3919
3922
  }
3920
3923
  async function listLinearIssues(agent, repoPath) {
3921
- const { getAdapter: getAdapter2 } = await import("./agents-KFAGRM46.js");
3924
+ const { getAdapter: getAdapter2 } = await import("./agents-3755WYQM.js");
3922
3925
  await requireAgent(agent, { requireLinear: true });
3923
3926
  const adapter = getAdapter2(agent);
3924
3927
  if (!adapter.listLinearIssues) {
@@ -4240,6 +4243,13 @@ var QUOTA_CONTINUE_PROMPT = (fromAgent, fallback) => [
4240
4243
  "Proceed with the goal. Leave model Auto unless needed."
4241
4244
  ].join(" ");
4242
4245
  var QUOTA_RESUME_PROMPT = "Session/usage limit window should have reset. Continue this chat from where you left off.";
4246
+ async function isolateQuotaFailover(run2) {
4247
+ try {
4248
+ return await run2();
4249
+ } catch {
4250
+ return true;
4251
+ }
4252
+ }
4243
4253
  function createQuotaFailoverChat(from, fallbackAgent, limitText) {
4244
4254
  const handoff = buildQuotaHandoffAttachment(from, limitText, fallbackAgent);
4245
4255
  const tab = createChatTab({
@@ -4357,7 +4367,7 @@ async function adoptThread(input) {
4357
4367
  messages: input.messages ?? []
4358
4368
  });
4359
4369
  writeThread(thread);
4360
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-RP76JH3J.js");
4370
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-IMG7ZRUQ.js");
4361
4371
  await ensureWorkspace2(repoPath);
4362
4372
  const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-X54WSOXM.js");
4363
4373
  await ensureWorktreeSideboardIgnored2(input.worktreePath);
@@ -6941,7 +6951,7 @@ function formatScheduledPrompt(name, prompt) {
6941
6951
  ${prompt}`;
6942
6952
  }
6943
6953
  async function defaultDeps() {
6944
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-SWWQQFFD.js");
6954
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-3A6KUTNI.js");
6945
6955
  const orch = getOrchestrator2();
6946
6956
  return {
6947
6957
  findThread: (id) => findThreadByRef(id),
@@ -7216,7 +7226,7 @@ var Orchestrator = class {
7216
7226
  orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
7217
7227
  });
7218
7228
  }
7219
- const { autoCleanupOrphansEnabled } = await import("./app-settings-AXCURTZJ.js");
7229
+ const { autoCleanupOrphansEnabled } = await import("./app-settings-YEPF46IJ.js");
7220
7230
  if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
7221
7231
  await cleanupOrphanWorktrees({ repoPaths });
7222
7232
  }
@@ -7332,62 +7342,75 @@ var Orchestrator = class {
7332
7342
  */
7333
7343
  async maybeHandleOrchestrationQuotaFailover(threadId, limitText) {
7334
7344
  const thread = findThreadByRef(threadId);
7335
- if (!thread) return;
7345
+ if (!thread) return false;
7336
7346
  const plan = planOrchestrationQuotaFailover(thread, limitText);
7337
- if (!plan || plan.action === "none") return;
7347
+ if (!plan || plan.action === "none") return false;
7338
7348
  if (plan.action === "wait_reset" && plan.resumeAt) {
7339
7349
  this.haltDrain.add(threadId);
7340
7350
  this.scheduleQuotaResume(threadId, plan.resumeAt);
7341
- setStatus(threadId, "idle", null);
7342
- appendMessage(threadId, {
7343
- role: "agent",
7344
- text: `Sideboard will auto-retry this chat around ${plan.resumeAt.toLocaleString()} when the session limit resets.`,
7345
- ts: (/* @__PURE__ */ new Date()).toISOString()
7346
- });
7347
- this.emit({
7348
- type: "quota_failover",
7349
- threadId,
7350
- action: "wait_reset",
7351
- message: plan.reason,
7352
- resumeAt: plan.resumeAt.toISOString()
7353
- });
7354
- this.emit({ type: "status_changed", threadId, status: "idle" });
7355
- return;
7351
+ try {
7352
+ setStatus(threadId, "idle", null);
7353
+ appendMessage(threadId, {
7354
+ role: "agent",
7355
+ text: `Sideboard will auto-retry this chat around ${plan.resumeAt.toLocaleString()} when the session limit resets.`,
7356
+ ts: (/* @__PURE__ */ new Date()).toISOString()
7357
+ });
7358
+ this.emit({
7359
+ type: "quota_failover",
7360
+ threadId,
7361
+ action: "wait_reset",
7362
+ message: plan.reason,
7363
+ resumeAt: plan.resumeAt.toISOString()
7364
+ });
7365
+ this.emit({ type: "status_changed", threadId, status: "idle" });
7366
+ } catch {
7367
+ }
7368
+ return true;
7356
7369
  }
7357
7370
  if (plan.action === "switch_agent" && plan.fallbackAgent) {
7358
7371
  this.haltDrain.add(threadId);
7359
- const next = createQuotaFailoverChat(
7360
- thread,
7361
- plan.fallbackAgent,
7362
- plan.limitText
7363
- );
7372
+ let next;
7373
+ try {
7374
+ next = createQuotaFailoverChat(
7375
+ thread,
7376
+ plan.fallbackAgent,
7377
+ plan.limitText
7378
+ );
7379
+ } catch {
7380
+ return false;
7381
+ }
7364
7382
  this.clearQuotaResumeTimer(threadId);
7365
7383
  try {
7366
7384
  updateThread(threadId, { quotaResumeAt: null });
7367
7385
  } catch {
7368
7386
  }
7369
- appendMessage(threadId, {
7370
- role: "agent",
7371
- text: `Session limit on ${thread.agent}. Sideboard continued on ${plan.fallbackAgent} (Auto) in [${next.title}](sideboard://thread/${next.id}).`,
7372
- ts: (/* @__PURE__ */ new Date()).toISOString()
7373
- });
7374
- this.emit({
7375
- type: "quota_failover",
7376
- threadId,
7377
- action: "switch_agent",
7378
- toThreadId: next.id,
7379
- message: plan.reason
7380
- });
7381
- this.emit({
7382
- type: "status_changed",
7383
- threadId: next.id,
7384
- status: next.status
7385
- });
7386
- await this.send(
7387
+ try {
7388
+ appendMessage(threadId, {
7389
+ role: "agent",
7390
+ text: `Session limit on ${thread.agent}. Sideboard continued on ${plan.fallbackAgent} (Auto) in [${next.title}](sideboard://thread/${next.id}).`,
7391
+ ts: (/* @__PURE__ */ new Date()).toISOString()
7392
+ });
7393
+ this.emit({
7394
+ type: "quota_failover",
7395
+ threadId,
7396
+ action: "switch_agent",
7397
+ toThreadId: next.id,
7398
+ message: plan.reason
7399
+ });
7400
+ this.emit({
7401
+ type: "status_changed",
7402
+ threadId: next.id,
7403
+ status: next.status
7404
+ });
7405
+ } catch {
7406
+ }
7407
+ void this.send(
7387
7408
  next.id,
7388
7409
  QUOTA_CONTINUE_PROMPT(thread.agent, plan.fallbackAgent)
7389
7410
  );
7411
+ return true;
7390
7412
  }
7413
+ return false;
7391
7414
  }
7392
7415
  /**
7393
7416
  * Cursor-style recovery: after a runner crash, feed the error back as the
@@ -7495,7 +7518,7 @@ var Orchestrator = class {
7495
7518
  }
7496
7519
  await setup;
7497
7520
  if (skipSetup) return;
7498
- const { autoRunAfterSetupEnabled } = await import("./app-settings-AXCURTZJ.js");
7521
+ const { autoRunAfterSetupEnabled } = await import("./app-settings-YEPF46IJ.js");
7499
7522
  if (autoRunAfterSetupEnabled()) {
7500
7523
  try {
7501
7524
  await this.startDev(threadId);
@@ -7819,7 +7842,7 @@ var Orchestrator = class {
7819
7842
  }
7820
7843
  const isBrightsy = fresh.agent === "brightsy";
7821
7844
  const isOrchestration = isOrchestratorThread(fresh);
7822
- const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-AXCURTZJ.js");
7845
+ const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-YEPF46IJ.js");
7823
7846
  const gitAuthMode = getGithubGitAuthMode();
7824
7847
  const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
7825
7848
  githubSlug: await resolveGithubRepoSlug(fresh.worktreePath).catch(
@@ -8111,13 +8134,18 @@ var Orchestrator = class {
8111
8134
  this.maybeEnqueueJobContinue(threadId, chatText, parts);
8112
8135
  } else {
8113
8136
  const blob = [chatText, detail].filter(Boolean).join("\n");
8114
- void this.maybeHandleOrchestrationQuotaFailover(threadId, blob);
8137
+ const failedOver = await isolateQuotaFailover(
8138
+ () => this.maybeHandleOrchestrationQuotaFailover(threadId, blob)
8139
+ );
8115
8140
  this.maybeEnqueueCrashContinue(threadId, {
8116
8141
  detail: detail || failDetail,
8117
8142
  assistantText: chatText,
8118
8143
  partsCount: parts.length
8119
8144
  });
8120
- if (!this.crashContinued.has(threadId)) {
8145
+ if (shouldNotifyParentAfterTurnError({
8146
+ quotaFailoverHandled: failedOver,
8147
+ crashContinued: this.crashContinued.has(threadId)
8148
+ })) {
8121
8149
  const failed = readThread(threadId);
8122
8150
  if (failed) {
8123
8151
  notifyParentOfChildHalt(failed, "error", (id, prompt2) => this.send(id, prompt2));
@@ -8141,13 +8169,18 @@ var Orchestrator = class {
8141
8169
  this.emit({ type: "status_changed", threadId, status: "error" });
8142
8170
  }
8143
8171
  this.emit({ type: "turn_finished", threadId, exitCode: 1 });
8144
- void this.maybeHandleOrchestrationQuotaFailover(threadId, message);
8172
+ const failedOver = await isolateQuotaFailover(
8173
+ () => this.maybeHandleOrchestrationQuotaFailover(threadId, message)
8174
+ );
8145
8175
  this.maybeEnqueueCrashContinue(threadId, {
8146
8176
  detail: message,
8147
8177
  assistantText: "",
8148
8178
  partsCount: 0
8149
8179
  });
8150
- if (!this.crashContinued.has(threadId)) {
8180
+ if (shouldNotifyParentAfterTurnError({
8181
+ quotaFailoverHandled: failedOver,
8182
+ crashContinued: this.crashContinued.has(threadId)
8183
+ })) {
8151
8184
  const failed = readThread(threadId);
8152
8185
  if (failed) {
8153
8186
  notifyParentOfChildHalt(failed, "error", (id, prompt2) => this.send(id, prompt2));
@@ -8804,7 +8837,7 @@ var Orchestrator = class {
8804
8837
  updateThread(thread.id, { title: meta.title });
8805
8838
  }
8806
8839
  }
8807
- const { autoArchiveOnMergeEnabled } = await import("./app-settings-AXCURTZJ.js");
8840
+ const { autoArchiveOnMergeEnabled } = await import("./app-settings-YEPF46IJ.js");
8808
8841
  const latest = this.requireThread(thread.id);
8809
8842
  if (!shouldAutoArchiveOnPrMerge({
8810
8843
  previousPrState: prevState || null,
@@ -9096,7 +9129,7 @@ var Orchestrator = class {
9096
9129
  this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
9097
9130
  if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
9098
9131
  try {
9099
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-RP76JH3J.js");
9132
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-IMG7ZRUQ.js");
9100
9133
  await ensureWorkspace2(thread.repoPath);
9101
9134
  } catch {
9102
9135
  }
@@ -9123,7 +9156,7 @@ var Orchestrator = class {
9123
9156
  await runArchiveScript(thread.repoPath, thread.worktreePath);
9124
9157
  } catch {
9125
9158
  }
9126
- const { deleteBranchOnPurgeEnabled } = await import("./app-settings-AXCURTZJ.js");
9159
+ const { deleteBranchOnPurgeEnabled } = await import("./app-settings-YEPF46IJ.js");
9127
9160
  const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
9128
9161
  await removeWorktree(thread.repoPath, thread.worktreePath, {
9129
9162
  deleteBranch: deleteBranch ? thread.branchName : void 0
@@ -9150,7 +9183,7 @@ var Orchestrator = class {
9150
9183
  `Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
9151
9184
  );
9152
9185
  }
9153
- const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-72TZWUSH.js");
9186
+ const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-JSCDJPBU.js");
9154
9187
  const slug = thread.worktreePath.split("/").pop();
9155
9188
  const dest = thread.worktreePath;
9156
9189
  await withRepoGitLock(thread.repoPath, async () => {
@@ -9260,7 +9293,7 @@ async function startOrchestration(opts) {
9260
9293
  sourceRef: "default",
9261
9294
  ...createOpts
9262
9295
  }).catch(async () => {
9263
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-72TZWUSH.js");
9296
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-JSCDJPBU.js");
9264
9297
  const repo = await resolveRepoRoot2(repoPath);
9265
9298
  const def = await resolveDefaultBranch2(repo);
9266
9299
  return orch.createThread({