@sideboard-ai/core 0.1.202 → 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-OXX3ONVY.js → agents-3755WYQM.js} +4 -4
  8. package/dist/{agents-573ZDIX6.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-7NKY2OX7.js → chunk-2DVCCLII.js} +78 -62
  12. package/dist/chunk-3PYH2RLA.js +388 -0
  13. package/dist/{chunk-A2TAKYSG.js → chunk-5IXJTUST.js} +4 -4
  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-27GGXX27.js → chunk-TZNJKZ2A.js} +82 -66
  26. package/dist/{chunk-NIVF5NDN.js → chunk-X2TFUFIS.js} +4 -4
  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 +912 -142
  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 +843 -114
  37. package/dist/mcp/run-stdio.js +22 -20
  38. package/dist/{orchestrator-JNSQDRZI.js → orchestrator-3A6KUTNI.js} +5 -5
  39. package/dist/{orchestrator-NCYKEI3E.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-A2TAKYSG.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-JNSQDRZI.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
  );
@@ -3761,7 +3761,7 @@ async function createThread(input, _onSetupLine) {
3761
3761
  });
3762
3762
  await requireAgent(resolved.agent);
3763
3763
  if (input.cowboy) {
3764
- const { cowboyModeEnabled } = await import("./app-settings-AXCURTZJ.js");
3764
+ const { cowboyModeEnabled } = await import("./app-settings-YEPF46IJ.js");
3765
3765
  if (!cowboyModeEnabled()) {
3766
3766
  throw new Error(
3767
3767
  "Cowboy mode is off. Enable it in Settings \u2192 Advanced."
@@ -3819,7 +3819,7 @@ async function createThread(input, _onSetupLine) {
3819
3819
  let sourceIsFork = false;
3820
3820
  if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
3821
3821
  if (isAbleTimeConnected() && getIssueSource() === "abletime") {
3822
- const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-345SE3B4.js");
3822
+ const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-SISJEPJ3.js");
3823
3823
  const task = await ensureAbleTimeTask({
3824
3824
  title: title?.trim() || "Untitled work",
3825
3825
  description: input.prompt?.trim() || void 0
@@ -3921,7 +3921,7 @@ async function createThread(input, _onSetupLine) {
3921
3921
  return readThread(thread.id) ?? thread;
3922
3922
  }
3923
3923
  async function listLinearIssues(agent, repoPath) {
3924
- const { getAdapter: getAdapter2 } = await import("./agents-OXX3ONVY.js");
3924
+ const { getAdapter: getAdapter2 } = await import("./agents-3755WYQM.js");
3925
3925
  await requireAgent(agent, { requireLinear: true });
3926
3926
  const adapter = getAdapter2(agent);
3927
3927
  if (!adapter.listLinearIssues) {
@@ -4243,6 +4243,13 @@ var QUOTA_CONTINUE_PROMPT = (fromAgent, fallback) => [
4243
4243
  "Proceed with the goal. Leave model Auto unless needed."
4244
4244
  ].join(" ");
4245
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
+ }
4246
4253
  function createQuotaFailoverChat(from, fallbackAgent, limitText) {
4247
4254
  const handoff = buildQuotaHandoffAttachment(from, limitText, fallbackAgent);
4248
4255
  const tab = createChatTab({
@@ -4360,7 +4367,7 @@ async function adoptThread(input) {
4360
4367
  messages: input.messages ?? []
4361
4368
  });
4362
4369
  writeThread(thread);
4363
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-RP76JH3J.js");
4370
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-IMG7ZRUQ.js");
4364
4371
  await ensureWorkspace2(repoPath);
4365
4372
  const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-X54WSOXM.js");
4366
4373
  await ensureWorktreeSideboardIgnored2(input.worktreePath);
@@ -6944,7 +6951,7 @@ function formatScheduledPrompt(name, prompt) {
6944
6951
  ${prompt}`;
6945
6952
  }
6946
6953
  async function defaultDeps() {
6947
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-JNSQDRZI.js");
6954
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-3A6KUTNI.js");
6948
6955
  const orch = getOrchestrator2();
6949
6956
  return {
6950
6957
  findThread: (id) => findThreadByRef(id),
@@ -7219,7 +7226,7 @@ var Orchestrator = class {
7219
7226
  orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
7220
7227
  });
7221
7228
  }
7222
- const { autoCleanupOrphansEnabled } = await import("./app-settings-AXCURTZJ.js");
7229
+ const { autoCleanupOrphansEnabled } = await import("./app-settings-YEPF46IJ.js");
7223
7230
  if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
7224
7231
  await cleanupOrphanWorktrees({ repoPaths });
7225
7232
  }
@@ -7341,51 +7348,62 @@ var Orchestrator = class {
7341
7348
  if (plan.action === "wait_reset" && plan.resumeAt) {
7342
7349
  this.haltDrain.add(threadId);
7343
7350
  this.scheduleQuotaResume(threadId, plan.resumeAt);
7344
- setStatus(threadId, "idle", null);
7345
- appendMessage(threadId, {
7346
- role: "agent",
7347
- text: `Sideboard will auto-retry this chat around ${plan.resumeAt.toLocaleString()} when the session limit resets.`,
7348
- ts: (/* @__PURE__ */ new Date()).toISOString()
7349
- });
7350
- this.emit({
7351
- type: "quota_failover",
7352
- threadId,
7353
- action: "wait_reset",
7354
- message: plan.reason,
7355
- resumeAt: plan.resumeAt.toISOString()
7356
- });
7357
- this.emit({ type: "status_changed", threadId, status: "idle" });
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
+ }
7358
7368
  return true;
7359
7369
  }
7360
7370
  if (plan.action === "switch_agent" && plan.fallbackAgent) {
7361
7371
  this.haltDrain.add(threadId);
7362
- const next = createQuotaFailoverChat(
7363
- thread,
7364
- plan.fallbackAgent,
7365
- plan.limitText
7366
- );
7372
+ let next;
7373
+ try {
7374
+ next = createQuotaFailoverChat(
7375
+ thread,
7376
+ plan.fallbackAgent,
7377
+ plan.limitText
7378
+ );
7379
+ } catch {
7380
+ return false;
7381
+ }
7367
7382
  this.clearQuotaResumeTimer(threadId);
7368
7383
  try {
7369
7384
  updateThread(threadId, { quotaResumeAt: null });
7370
7385
  } catch {
7371
7386
  }
7372
- appendMessage(threadId, {
7373
- role: "agent",
7374
- text: `Session limit on ${thread.agent}. Sideboard continued on ${plan.fallbackAgent} (Auto) in [${next.title}](sideboard://thread/${next.id}).`,
7375
- ts: (/* @__PURE__ */ new Date()).toISOString()
7376
- });
7377
- this.emit({
7378
- type: "quota_failover",
7379
- threadId,
7380
- action: "switch_agent",
7381
- toThreadId: next.id,
7382
- message: plan.reason
7383
- });
7384
- this.emit({
7385
- type: "status_changed",
7386
- threadId: next.id,
7387
- status: next.status
7388
- });
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
+ }
7389
7407
  void this.send(
7390
7408
  next.id,
7391
7409
  QUOTA_CONTINUE_PROMPT(thread.agent, plan.fallbackAgent)
@@ -7500,7 +7518,7 @@ var Orchestrator = class {
7500
7518
  }
7501
7519
  await setup;
7502
7520
  if (skipSetup) return;
7503
- const { autoRunAfterSetupEnabled } = await import("./app-settings-AXCURTZJ.js");
7521
+ const { autoRunAfterSetupEnabled } = await import("./app-settings-YEPF46IJ.js");
7504
7522
  if (autoRunAfterSetupEnabled()) {
7505
7523
  try {
7506
7524
  await this.startDev(threadId);
@@ -7824,7 +7842,7 @@ var Orchestrator = class {
7824
7842
  }
7825
7843
  const isBrightsy = fresh.agent === "brightsy";
7826
7844
  const isOrchestration = isOrchestratorThread(fresh);
7827
- const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-AXCURTZJ.js");
7845
+ const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-YEPF46IJ.js");
7828
7846
  const gitAuthMode = getGithubGitAuthMode();
7829
7847
  const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
7830
7848
  githubSlug: await resolveGithubRepoSlug(fresh.worktreePath).catch(
@@ -8116,9 +8134,8 @@ var Orchestrator = class {
8116
8134
  this.maybeEnqueueJobContinue(threadId, chatText, parts);
8117
8135
  } else {
8118
8136
  const blob = [chatText, detail].filter(Boolean).join("\n");
8119
- const failedOver = await this.maybeHandleOrchestrationQuotaFailover(
8120
- threadId,
8121
- blob
8137
+ const failedOver = await isolateQuotaFailover(
8138
+ () => this.maybeHandleOrchestrationQuotaFailover(threadId, blob)
8122
8139
  );
8123
8140
  this.maybeEnqueueCrashContinue(threadId, {
8124
8141
  detail: detail || failDetail,
@@ -8152,9 +8169,8 @@ var Orchestrator = class {
8152
8169
  this.emit({ type: "status_changed", threadId, status: "error" });
8153
8170
  }
8154
8171
  this.emit({ type: "turn_finished", threadId, exitCode: 1 });
8155
- const failedOver = await this.maybeHandleOrchestrationQuotaFailover(
8156
- threadId,
8157
- message
8172
+ const failedOver = await isolateQuotaFailover(
8173
+ () => this.maybeHandleOrchestrationQuotaFailover(threadId, message)
8158
8174
  );
8159
8175
  this.maybeEnqueueCrashContinue(threadId, {
8160
8176
  detail: message,
@@ -8821,7 +8837,7 @@ var Orchestrator = class {
8821
8837
  updateThread(thread.id, { title: meta.title });
8822
8838
  }
8823
8839
  }
8824
- const { autoArchiveOnMergeEnabled } = await import("./app-settings-AXCURTZJ.js");
8840
+ const { autoArchiveOnMergeEnabled } = await import("./app-settings-YEPF46IJ.js");
8825
8841
  const latest = this.requireThread(thread.id);
8826
8842
  if (!shouldAutoArchiveOnPrMerge({
8827
8843
  previousPrState: prevState || null,
@@ -9113,7 +9129,7 @@ var Orchestrator = class {
9113
9129
  this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
9114
9130
  if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
9115
9131
  try {
9116
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-RP76JH3J.js");
9132
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-IMG7ZRUQ.js");
9117
9133
  await ensureWorkspace2(thread.repoPath);
9118
9134
  } catch {
9119
9135
  }
@@ -9140,7 +9156,7 @@ var Orchestrator = class {
9140
9156
  await runArchiveScript(thread.repoPath, thread.worktreePath);
9141
9157
  } catch {
9142
9158
  }
9143
- const { deleteBranchOnPurgeEnabled } = await import("./app-settings-AXCURTZJ.js");
9159
+ const { deleteBranchOnPurgeEnabled } = await import("./app-settings-YEPF46IJ.js");
9144
9160
  const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
9145
9161
  await removeWorktree(thread.repoPath, thread.worktreePath, {
9146
9162
  deleteBranch: deleteBranch ? thread.branchName : void 0
@@ -9167,7 +9183,7 @@ var Orchestrator = class {
9167
9183
  `Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
9168
9184
  );
9169
9185
  }
9170
- const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-72TZWUSH.js");
9186
+ const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-JSCDJPBU.js");
9171
9187
  const slug = thread.worktreePath.split("/").pop();
9172
9188
  const dest = thread.worktreePath;
9173
9189
  await withRepoGitLock(thread.repoPath, async () => {
@@ -9277,7 +9293,7 @@ async function startOrchestration(opts) {
9277
9293
  sourceRef: "default",
9278
9294
  ...createOpts
9279
9295
  }).catch(async () => {
9280
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-72TZWUSH.js");
9296
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-JSCDJPBU.js");
9281
9297
  const repo = await resolveRepoRoot2(repoPath);
9282
9298
  const def = await resolveDefaultBranch2(repo);
9283
9299
  return orch.createThread({