@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
@@ -1,5 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ import {
4
+ extractPresentedPlan,
5
+ readPlanFile,
6
+ writePlanFile
7
+ } from "./chunk-JFOPOMK7.js";
3
8
  import {
4
9
  releaseCaffeinateHoldForThread
5
10
  } from "./chunk-YWI3IBP2.js";
@@ -38,7 +43,7 @@ import {
38
43
  summarizeTurnStderr,
39
44
  toolDescription,
40
45
  turnFailChatText
41
- } from "./chunk-3TOGAUQT.js";
46
+ } from "./chunk-X2TFUFIS.js";
42
47
  import {
43
48
  SLACK_REPLY_FORMATTING,
44
49
  addWorkspace,
@@ -61,12 +66,7 @@ import {
61
66
  stageAbsolutePathsAsAttachments,
62
67
  stageBuffersAsAttachments,
63
68
  syncWorkspacesFromThreads
64
- } from "./chunk-54RSAMBH.js";
65
- import {
66
- extractPresentedPlan,
67
- readPlanFile,
68
- writePlanFile
69
- } from "./chunk-JFOPOMK7.js";
69
+ } from "./chunk-LCU6GBZP.js";
70
70
  import {
71
71
  addPrStackLayer,
72
72
  allocateTeamName,
@@ -116,7 +116,7 @@ import {
116
116
  worktreeDisplayLabelForGroup,
117
117
  worktreeNameFromPath,
118
118
  worktreeSlugForTicket
119
- } from "./chunk-RPX6VDW7.js";
119
+ } from "./chunk-QSEF2YVQ.js";
120
120
  import {
121
121
  ATTACHMENTS_DIR,
122
122
  DETACHED_JOBS_DIR,
@@ -170,7 +170,7 @@ import {
170
170
  updateAdvancedSettings,
171
171
  usageOnLimit,
172
172
  writeSecureJson
173
- } from "./chunk-ISV5IFH3.js";
173
+ } from "./chunk-X743YN5Y.js";
174
174
  import {
175
175
  writePrivateFile
176
176
  } from "./chunk-NSTQ6QKD.js";
@@ -408,7 +408,7 @@ async function continueSourceThread(threadId, prompt) {
408
408
  await continueOnReply(threadId, prompt);
409
409
  return;
410
410
  }
411
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-47JZUHRC.js");
411
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-Q33M24ZJ.js");
412
412
  await getOrchestrator2().send(threadId, prompt);
413
413
  } catch {
414
414
  }
@@ -801,9 +801,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
801
801
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
802
802
  );
803
803
  }
804
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-NLLAPQJI.js");
804
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-JPJ3FKKY.js");
805
805
  if (isGlobalThread2(thread)) {
806
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-BH4EHFOO.js");
806
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-U4PEZDAW.js");
807
807
  ensureGlobalCoordinatorCwd2(
808
808
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
809
809
  );
@@ -2630,6 +2630,9 @@ function childHaltNotice(child, status) {
2630
2630
  "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."
2631
2631
  ].join("\n");
2632
2632
  }
2633
+ function shouldNotifyParentAfterTurnError(opts) {
2634
+ return !opts.quotaFailoverHandled && !opts.crashContinued;
2635
+ }
2633
2636
  function shouldNotifyParentOfChildHalt(opts) {
2634
2637
  if (!isIncompleteChildStatus(opts.status)) return false;
2635
2638
  if (!opts.child.parentThreadId) return false;
@@ -3599,7 +3602,7 @@ async function createThread(input, _onSetupLine) {
3599
3602
  });
3600
3603
  await requireAgent(resolved.agent);
3601
3604
  if (input.cowboy) {
3602
- const { cowboyModeEnabled } = await import("./app-settings-V6IHESEQ.js");
3605
+ const { cowboyModeEnabled } = await import("./app-settings-LGHMNHSP.js");
3603
3606
  if (!cowboyModeEnabled()) {
3604
3607
  throw new Error(
3605
3608
  "Cowboy mode is off. Enable it in Settings \u2192 Advanced."
@@ -3657,7 +3660,7 @@ async function createThread(input, _onSetupLine) {
3657
3660
  let sourceIsFork = false;
3658
3661
  if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
3659
3662
  if (isAbleTimeConnected() && getIssueSource() === "abletime") {
3660
- const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-KGPD3UUJ.js");
3663
+ const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-JFGZBDHH.js");
3661
3664
  const task = await ensureAbleTimeTask({
3662
3665
  title: title?.trim() || "Untitled work",
3663
3666
  description: input.prompt?.trim() || void 0
@@ -4069,6 +4072,13 @@ var QUOTA_CONTINUE_PROMPT = (fromAgent, fallback) => [
4069
4072
  "Proceed with the goal. Leave model Auto unless needed."
4070
4073
  ].join(" ");
4071
4074
  var QUOTA_RESUME_PROMPT = "Session/usage limit window should have reset. Continue this chat from where you left off.";
4075
+ async function isolateQuotaFailover(run2) {
4076
+ try {
4077
+ return await run2();
4078
+ } catch {
4079
+ return true;
4080
+ }
4081
+ }
4072
4082
  function createQuotaFailoverChat(from, fallbackAgent, limitText) {
4073
4083
  const handoff = buildQuotaHandoffAttachment(from, limitText, fallbackAgent);
4074
4084
  const tab = createChatTab({
@@ -4186,7 +4196,7 @@ async function adoptThread(input) {
4186
4196
  messages: input.messages ?? []
4187
4197
  });
4188
4198
  writeThread(thread);
4189
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-PEWYWVHZ.js");
4199
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-U6P6DB44.js");
4190
4200
  await ensureWorkspace2(repoPath);
4191
4201
  const { ensureWorktreeSideboardIgnored: ensureWorktreeSideboardIgnored2 } = await import("./worktree-exclude-N5X5I422.js");
4192
4202
  await ensureWorktreeSideboardIgnored2(input.worktreePath);
@@ -6564,7 +6574,7 @@ function formatScheduledPrompt(name, prompt) {
6564
6574
  ${prompt}`;
6565
6575
  }
6566
6576
  async function defaultDeps() {
6567
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-47JZUHRC.js");
6577
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-Q33M24ZJ.js");
6568
6578
  const orch = getOrchestrator2();
6569
6579
  return {
6570
6580
  findThread: (id) => findThreadByRef(id),
@@ -6839,7 +6849,7 @@ var Orchestrator = class {
6839
6849
  orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
6840
6850
  });
6841
6851
  }
6842
- const { autoCleanupOrphansEnabled } = await import("./app-settings-V6IHESEQ.js");
6852
+ const { autoCleanupOrphansEnabled } = await import("./app-settings-LGHMNHSP.js");
6843
6853
  if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
6844
6854
  await cleanupOrphanWorktrees({ repoPaths });
6845
6855
  }
@@ -6955,62 +6965,75 @@ var Orchestrator = class {
6955
6965
  */
6956
6966
  async maybeHandleOrchestrationQuotaFailover(threadId, limitText) {
6957
6967
  const thread = findThreadByRef(threadId);
6958
- if (!thread) return;
6968
+ if (!thread) return false;
6959
6969
  const plan = planOrchestrationQuotaFailover(thread, limitText);
6960
- if (!plan || plan.action === "none") return;
6970
+ if (!plan || plan.action === "none") return false;
6961
6971
  if (plan.action === "wait_reset" && plan.resumeAt) {
6962
6972
  this.haltDrain.add(threadId);
6963
6973
  this.scheduleQuotaResume(threadId, plan.resumeAt);
6964
- setStatus(threadId, "idle", null);
6965
- appendMessage(threadId, {
6966
- role: "agent",
6967
- text: `Sideboard will auto-retry this chat around ${plan.resumeAt.toLocaleString()} when the session limit resets.`,
6968
- ts: (/* @__PURE__ */ new Date()).toISOString()
6969
- });
6970
- this.emit({
6971
- type: "quota_failover",
6972
- threadId,
6973
- action: "wait_reset",
6974
- message: plan.reason,
6975
- resumeAt: plan.resumeAt.toISOString()
6976
- });
6977
- this.emit({ type: "status_changed", threadId, status: "idle" });
6978
- return;
6974
+ try {
6975
+ setStatus(threadId, "idle", null);
6976
+ appendMessage(threadId, {
6977
+ role: "agent",
6978
+ text: `Sideboard will auto-retry this chat around ${plan.resumeAt.toLocaleString()} when the session limit resets.`,
6979
+ ts: (/* @__PURE__ */ new Date()).toISOString()
6980
+ });
6981
+ this.emit({
6982
+ type: "quota_failover",
6983
+ threadId,
6984
+ action: "wait_reset",
6985
+ message: plan.reason,
6986
+ resumeAt: plan.resumeAt.toISOString()
6987
+ });
6988
+ this.emit({ type: "status_changed", threadId, status: "idle" });
6989
+ } catch {
6990
+ }
6991
+ return true;
6979
6992
  }
6980
6993
  if (plan.action === "switch_agent" && plan.fallbackAgent) {
6981
6994
  this.haltDrain.add(threadId);
6982
- const next = createQuotaFailoverChat(
6983
- thread,
6984
- plan.fallbackAgent,
6985
- plan.limitText
6986
- );
6995
+ let next;
6996
+ try {
6997
+ next = createQuotaFailoverChat(
6998
+ thread,
6999
+ plan.fallbackAgent,
7000
+ plan.limitText
7001
+ );
7002
+ } catch {
7003
+ return false;
7004
+ }
6987
7005
  this.clearQuotaResumeTimer(threadId);
6988
7006
  try {
6989
7007
  updateThread(threadId, { quotaResumeAt: null });
6990
7008
  } catch {
6991
7009
  }
6992
- appendMessage(threadId, {
6993
- role: "agent",
6994
- text: `Session limit on ${thread.agent}. Sideboard continued on ${plan.fallbackAgent} (Auto) in [${next.title}](sideboard://thread/${next.id}).`,
6995
- ts: (/* @__PURE__ */ new Date()).toISOString()
6996
- });
6997
- this.emit({
6998
- type: "quota_failover",
6999
- threadId,
7000
- action: "switch_agent",
7001
- toThreadId: next.id,
7002
- message: plan.reason
7003
- });
7004
- this.emit({
7005
- type: "status_changed",
7006
- threadId: next.id,
7007
- status: next.status
7008
- });
7009
- await this.send(
7010
+ try {
7011
+ appendMessage(threadId, {
7012
+ role: "agent",
7013
+ text: `Session limit on ${thread.agent}. Sideboard continued on ${plan.fallbackAgent} (Auto) in [${next.title}](sideboard://thread/${next.id}).`,
7014
+ ts: (/* @__PURE__ */ new Date()).toISOString()
7015
+ });
7016
+ this.emit({
7017
+ type: "quota_failover",
7018
+ threadId,
7019
+ action: "switch_agent",
7020
+ toThreadId: next.id,
7021
+ message: plan.reason
7022
+ });
7023
+ this.emit({
7024
+ type: "status_changed",
7025
+ threadId: next.id,
7026
+ status: next.status
7027
+ });
7028
+ } catch {
7029
+ }
7030
+ void this.send(
7010
7031
  next.id,
7011
7032
  QUOTA_CONTINUE_PROMPT(thread.agent, plan.fallbackAgent)
7012
7033
  );
7034
+ return true;
7013
7035
  }
7036
+ return false;
7014
7037
  }
7015
7038
  /**
7016
7039
  * Cursor-style recovery: after a runner crash, feed the error back as the
@@ -7118,7 +7141,7 @@ var Orchestrator = class {
7118
7141
  }
7119
7142
  await setup;
7120
7143
  if (skipSetup) return;
7121
- const { autoRunAfterSetupEnabled } = await import("./app-settings-V6IHESEQ.js");
7144
+ const { autoRunAfterSetupEnabled } = await import("./app-settings-LGHMNHSP.js");
7122
7145
  if (autoRunAfterSetupEnabled()) {
7123
7146
  try {
7124
7147
  await this.startDev(threadId);
@@ -7442,7 +7465,7 @@ var Orchestrator = class {
7442
7465
  }
7443
7466
  const isBrightsy = fresh.agent === "brightsy";
7444
7467
  const isOrchestration = isOrchestratorThread(fresh);
7445
- const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-V6IHESEQ.js");
7468
+ const { autoRenameBranchEnabled, getGithubGitAuthMode, gitBranchPrefixSetting } = await import("./app-settings-LGHMNHSP.js");
7446
7469
  const gitAuthMode = getGithubGitAuthMode();
7447
7470
  const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
7448
7471
  githubSlug: await resolveGithubRepoSlug(fresh.worktreePath).catch(
@@ -7734,13 +7757,18 @@ var Orchestrator = class {
7734
7757
  this.maybeEnqueueJobContinue(threadId, chatText, parts);
7735
7758
  } else {
7736
7759
  const blob = [chatText, detail].filter(Boolean).join("\n");
7737
- void this.maybeHandleOrchestrationQuotaFailover(threadId, blob);
7760
+ const failedOver = await isolateQuotaFailover(
7761
+ () => this.maybeHandleOrchestrationQuotaFailover(threadId, blob)
7762
+ );
7738
7763
  this.maybeEnqueueCrashContinue(threadId, {
7739
7764
  detail: detail || failDetail,
7740
7765
  assistantText: chatText,
7741
7766
  partsCount: parts.length
7742
7767
  });
7743
- if (!this.crashContinued.has(threadId)) {
7768
+ if (shouldNotifyParentAfterTurnError({
7769
+ quotaFailoverHandled: failedOver,
7770
+ crashContinued: this.crashContinued.has(threadId)
7771
+ })) {
7744
7772
  const failed = readThread(threadId);
7745
7773
  if (failed) {
7746
7774
  notifyParentOfChildHalt(failed, "error", (id, prompt2) => this.send(id, prompt2));
@@ -7764,13 +7792,18 @@ var Orchestrator = class {
7764
7792
  this.emit({ type: "status_changed", threadId, status: "error" });
7765
7793
  }
7766
7794
  this.emit({ type: "turn_finished", threadId, exitCode: 1 });
7767
- void this.maybeHandleOrchestrationQuotaFailover(threadId, message);
7795
+ const failedOver = await isolateQuotaFailover(
7796
+ () => this.maybeHandleOrchestrationQuotaFailover(threadId, message)
7797
+ );
7768
7798
  this.maybeEnqueueCrashContinue(threadId, {
7769
7799
  detail: message,
7770
7800
  assistantText: "",
7771
7801
  partsCount: 0
7772
7802
  });
7773
- if (!this.crashContinued.has(threadId)) {
7803
+ if (shouldNotifyParentAfterTurnError({
7804
+ quotaFailoverHandled: failedOver,
7805
+ crashContinued: this.crashContinued.has(threadId)
7806
+ })) {
7774
7807
  const failed = readThread(threadId);
7775
7808
  if (failed) {
7776
7809
  notifyParentOfChildHalt(failed, "error", (id, prompt2) => this.send(id, prompt2));
@@ -8427,7 +8460,7 @@ var Orchestrator = class {
8427
8460
  updateThread(thread.id, { title: meta.title });
8428
8461
  }
8429
8462
  }
8430
- const { autoArchiveOnMergeEnabled } = await import("./app-settings-V6IHESEQ.js");
8463
+ const { autoArchiveOnMergeEnabled } = await import("./app-settings-LGHMNHSP.js");
8431
8464
  const latest = this.requireThread(thread.id);
8432
8465
  if (!shouldAutoArchiveOnPrMerge({
8433
8466
  previousPrState: prevState || null,
@@ -8719,7 +8752,7 @@ var Orchestrator = class {
8719
8752
  this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
8720
8753
  if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
8721
8754
  try {
8722
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-PEWYWVHZ.js");
8755
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-U6P6DB44.js");
8723
8756
  await ensureWorkspace2(thread.repoPath);
8724
8757
  } catch {
8725
8758
  }
@@ -8746,7 +8779,7 @@ var Orchestrator = class {
8746
8779
  await runArchiveScript(thread.repoPath, thread.worktreePath);
8747
8780
  } catch {
8748
8781
  }
8749
- const { deleteBranchOnPurgeEnabled } = await import("./app-settings-V6IHESEQ.js");
8782
+ const { deleteBranchOnPurgeEnabled } = await import("./app-settings-LGHMNHSP.js");
8750
8783
  const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
8751
8784
  await removeWorktree(thread.repoPath, thread.worktreePath, {
8752
8785
  deleteBranch: deleteBranch ? thread.branchName : void 0
@@ -8773,7 +8806,7 @@ var Orchestrator = class {
8773
8806
  `Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
8774
8807
  );
8775
8808
  }
8776
- const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-ZQEUKSNE.js");
8809
+ const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-FL3UIUKQ.js");
8777
8810
  const slug = thread.worktreePath.split("/").pop();
8778
8811
  const dest = thread.worktreePath;
8779
8812
  await withRepoGitLock(thread.repoPath, async () => {
@@ -8883,7 +8916,7 @@ async function startOrchestration(opts) {
8883
8916
  sourceRef: "default",
8884
8917
  ...createOpts
8885
8918
  }).catch(async () => {
8886
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-ZQEUKSNE.js");
8919
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-FL3UIUKQ.js");
8887
8920
  const repo = await resolveRepoRoot2(repoPath);
8888
8921
  const def = await resolveDefaultBranch2(repo);
8889
8922
  return orch.createThread({
@@ -2,7 +2,7 @@
2
2
 
3
3
  import {
4
4
  isOrchestratorThread
5
- } from "./chunk-54RSAMBH.js";
5
+ } from "./chunk-LCU6GBZP.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-RPX6VDW7.js";
23
+ } from "./chunk-QSEF2YVQ.js";
24
24
  import {
25
25
  enrichPathWithNpmGlobalBin,
26
26
  isConductorBundledCli,
@@ -38,7 +38,7 @@ import {
38
38
  resolveClaudeExecutable,
39
39
  unwrapStrippedElectronLaunch,
40
40
  wrapElectronAsNodeLaunch
41
- } from "./chunk-ISV5IFH3.js";
41
+ } from "./chunk-X743YN5Y.js";
42
42
  import {
43
43
  appDataDir
44
44
  } from "./chunk-EQNRWDLN.js";
@@ -1207,7 +1207,7 @@ function applyAgentEvent(parts, event) {
1207
1207
  next.push(
1208
1208
  withPartTimes({
1209
1209
  type: "thinking",
1210
- text: data,
1210
+ text: clipThinkingForStore(data),
1211
1211
  ...event.parentId ? { parentId: event.parentId } : {}
1212
1212
  })
1213
1213
  );
@@ -2423,7 +2423,7 @@ var claudeAdapter = {
2423
2423
  );
2424
2424
  }
2425
2425
  const mode = permissionMode(thread);
2426
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-NLLAPQJI.js");
2426
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-JPJ3FKKY.js");
2427
2427
  const isOrchestrator = isOrchestratorThread2(thread);
2428
2428
  const injectedServers = await buildInjectedMcpServers({
2429
2429
  includeSideboard: true,
@@ -356,6 +356,9 @@ function normalizeVault(raw) {
356
356
  if (typeof raw.abletimeAccessToken === "string" && raw.abletimeAccessToken.trim()) {
357
357
  out.abletimeAccessToken = raw.abletimeAccessToken.trim();
358
358
  }
359
+ if (typeof raw.abletimeRefreshToken === "string" && raw.abletimeRefreshToken.trim()) {
360
+ out.abletimeRefreshToken = raw.abletimeRefreshToken.trim();
361
+ }
359
362
  if (typeof raw.vercelToken === "string" && raw.vercelToken.trim()) {
360
363
  out.vercelToken = raw.vercelToken.trim();
361
364
  }
@@ -437,6 +440,7 @@ function emptyPublicIntegrations() {
437
440
  hasSlackAppToken: false,
438
441
  hasGithubPat: false,
439
442
  hasAbleTimeToken: false,
443
+ hasAbleTimeOAuth: false,
440
444
  hasVercelToken: false,
441
445
  hasSupabaseToken: false,
442
446
  hasPosthogToken: false,
@@ -461,6 +465,7 @@ function toPublicAppSettings(settings) {
461
465
  const slackAppToken = integrations.slackAppToken;
462
466
  const githubPat = integrations.githubPat;
463
467
  const abletimeAccessToken = integrations.abletimeAccessToken;
468
+ const abletimeRefreshToken = integrations.abletimeRefreshToken;
464
469
  const vercelToken = integrations.vercelToken;
465
470
  const supabaseAccessToken = integrations.supabaseAccessToken;
466
471
  const posthogPersonalApiKey = integrations.posthogPersonalApiKey;
@@ -473,6 +478,7 @@ function toPublicAppSettings(settings) {
473
478
  delete integrations.slackAppToken;
474
479
  delete integrations.githubPat;
475
480
  delete integrations.abletimeAccessToken;
481
+ delete integrations.abletimeRefreshToken;
476
482
  delete integrations.vercelToken;
477
483
  delete integrations.supabaseAccessToken;
478
484
  delete integrations.posthogPersonalApiKey;
@@ -487,7 +493,8 @@ function toPublicAppSettings(settings) {
487
493
  hasSlackClientSecret: Boolean(slackClientSecret?.trim()),
488
494
  hasSlackAppToken: Boolean(slackAppToken?.trim()),
489
495
  hasGithubPat: Boolean(githubPat?.trim()),
490
- hasAbleTimeToken: Boolean(abletimeAccessToken?.trim()),
496
+ hasAbleTimeToken: Boolean(abletimeAccessToken?.trim() || abletimeRefreshToken?.trim()),
497
+ hasAbleTimeOAuth: Boolean(abletimeRefreshToken?.trim()),
491
498
  hasVercelToken: Boolean(vercelToken?.trim()),
492
499
  hasSupabaseToken: Boolean(supabaseAccessToken?.trim()),
493
500
  hasPosthogToken: Boolean(posthogPersonalApiKey?.trim()),
@@ -633,6 +640,16 @@ function normalizeIntegrations(raw) {
633
640
  const token = source.abletimeAccessToken.trim();
634
641
  if (token) out.abletimeAccessToken = token;
635
642
  }
643
+ if (typeof source.abletimeRefreshToken === "string") {
644
+ const token = source.abletimeRefreshToken.trim();
645
+ if (token) out.abletimeRefreshToken = token;
646
+ }
647
+ if (typeof source.abletimeTokenExpiresAt === "number" && Number.isFinite(source.abletimeTokenExpiresAt)) {
648
+ out.abletimeTokenExpiresAt = source.abletimeTokenExpiresAt;
649
+ } else if (typeof source.abletimeTokenExpiresAt === "string") {
650
+ const n = Number(source.abletimeTokenExpiresAt);
651
+ if (Number.isFinite(n)) out.abletimeTokenExpiresAt = n;
652
+ }
636
653
  if (typeof source.abletimeHost === "string") {
637
654
  const host = source.abletimeHost.trim();
638
655
  if (host) out.abletimeHost = host;
@@ -921,7 +938,7 @@ function readSettingsFile() {
921
938
  }
922
939
  function diskHoldsSecrets(disk) {
923
940
  return Boolean(
924
- disk.integrations.linearApiKey || disk.integrations.linearAccessToken || disk.integrations.linearRefreshToken || disk.integrations.linearClientSecret || disk.integrations.slackClientSecret || disk.integrations.slackAppToken || disk.integrations.githubPat || disk.integrations.abletimeAccessToken || disk.integrations.vercelToken || disk.integrations.supabaseAccessToken || disk.integrations.posthogPersonalApiKey || disk.integrations.sentryAuthToken || Object.keys(disk.environment).length > 0
941
+ disk.integrations.linearApiKey || disk.integrations.linearAccessToken || disk.integrations.linearRefreshToken || disk.integrations.linearClientSecret || disk.integrations.slackClientSecret || disk.integrations.slackAppToken || disk.integrations.githubPat || disk.integrations.abletimeAccessToken || disk.integrations.abletimeRefreshToken || disk.integrations.vercelToken || disk.integrations.supabaseAccessToken || disk.integrations.posthogPersonalApiKey || disk.integrations.sentryAuthToken || Object.keys(disk.environment).length > 0
925
942
  );
926
943
  }
927
944
  function mergeVault(disk) {
@@ -952,6 +969,9 @@ function mergeVault(disk) {
952
969
  if (vault.abletimeAccessToken && !integrations.abletimeAccessToken) {
953
970
  integrations.abletimeAccessToken = vault.abletimeAccessToken;
954
971
  }
972
+ if (vault.abletimeRefreshToken && !integrations.abletimeRefreshToken) {
973
+ integrations.abletimeRefreshToken = vault.abletimeRefreshToken;
974
+ }
955
975
  if (vault.vercelToken && !integrations.vercelToken) {
956
976
  integrations.vercelToken = vault.vercelToken;
957
977
  }
@@ -976,6 +996,7 @@ function persistSplit(settings) {
976
996
  const slackAppToken = integrations.slackAppToken;
977
997
  const githubPat = integrations.githubPat;
978
998
  const abletimeAccessToken = integrations.abletimeAccessToken;
999
+ const abletimeRefreshToken = integrations.abletimeRefreshToken;
979
1000
  const vercelToken = integrations.vercelToken;
980
1001
  const supabaseAccessToken = integrations.supabaseAccessToken;
981
1002
  const posthogPersonalApiKey = integrations.posthogPersonalApiKey;
@@ -988,6 +1009,7 @@ function persistSplit(settings) {
988
1009
  delete integrations.slackAppToken;
989
1010
  delete integrations.githubPat;
990
1011
  delete integrations.abletimeAccessToken;
1012
+ delete integrations.abletimeRefreshToken;
991
1013
  delete integrations.vercelToken;
992
1014
  delete integrations.supabaseAccessToken;
993
1015
  delete integrations.posthogPersonalApiKey;
@@ -1006,6 +1028,7 @@ function persistSplit(settings) {
1006
1028
  slackAppToken,
1007
1029
  githubPat,
1008
1030
  abletimeAccessToken,
1031
+ abletimeRefreshToken,
1009
1032
  vercelToken,
1010
1033
  supabaseAccessToken,
1011
1034
  posthogPersonalApiKey,
@@ -1192,6 +1215,8 @@ function updateIntegrationsSettings(patch) {
1192
1215
  if ("abletimeAccessToken" in patch) {
1193
1216
  if (patch.abletimeAccessToken == null || patch.abletimeAccessToken.trim() === "") {
1194
1217
  delete integrations.abletimeAccessToken;
1218
+ delete integrations.abletimeRefreshToken;
1219
+ delete integrations.abletimeTokenExpiresAt;
1195
1220
  delete integrations.abletimeViewerName;
1196
1221
  } else {
1197
1222
  integrations.abletimeAccessToken = patch.abletimeAccessToken.trim();
@@ -1544,7 +1569,9 @@ function disconnectLinearConnection() {
1544
1569
  return saveAppSettings({ ...current, integrations });
1545
1570
  }
1546
1571
  function isAbleTimeConnected(settings = loadAppSettings()) {
1547
- return Boolean(settings.integrations.abletimeAccessToken?.trim());
1572
+ return Boolean(
1573
+ settings.integrations.abletimeAccessToken?.trim() || settings.integrations.abletimeRefreshToken?.trim()
1574
+ );
1548
1575
  }
1549
1576
  function getAbleTimeAccessToken(settings = loadAppSettings()) {
1550
1577
  const token = settings.integrations.abletimeAccessToken?.trim();
@@ -1557,6 +1584,12 @@ function saveAbleTimeConnection(input) {
1557
1584
  const current = loadAppSettings();
1558
1585
  const integrations = { ...current.integrations };
1559
1586
  integrations.abletimeAccessToken = input.accessToken.trim();
1587
+ if (input.refreshToken?.trim()) {
1588
+ integrations.abletimeRefreshToken = input.refreshToken.trim();
1589
+ }
1590
+ if (typeof input.expiresIn === "number" && Number.isFinite(input.expiresIn)) {
1591
+ integrations.abletimeTokenExpiresAt = Date.now() + Math.max(0, input.expiresIn) * 1e3;
1592
+ }
1560
1593
  if (input.host?.trim()) {
1561
1594
  integrations.abletimeHost = input.host.trim();
1562
1595
  }
@@ -1569,6 +1602,8 @@ function disconnectAbleTimeConnection() {
1569
1602
  const current = loadAppSettings();
1570
1603
  const integrations = { ...current.integrations };
1571
1604
  delete integrations.abletimeAccessToken;
1605
+ delete integrations.abletimeRefreshToken;
1606
+ delete integrations.abletimeTokenExpiresAt;
1572
1607
  delete integrations.abletimeViewerName;
1573
1608
  return saveAppSettings({ ...current, integrations });
1574
1609
  }
@@ -7,11 +7,11 @@ import {
7
7
  enrichWorkspacesWithGithub,
8
8
  ensureGlobalCoordinatorCwd,
9
9
  formatWorkspaceInventory
10
- } from "./chunk-LJHC62LZ.js";
11
- import "./chunk-STPZQR5B.js";
10
+ } from "./chunk-TNDUTGDV.js";
11
+ import "./chunk-CMGRV36E.js";
12
12
  import "./chunk-6K64FJDD.js";
13
13
  import "./chunk-QQKDGPUI.js";
14
- import "./chunk-CXFW5LIH.js";
14
+ import "./chunk-QFBBUFD4.js";
15
15
  import "./chunk-4TR3HZFT.js";
16
16
  import "./chunk-WDRMZKVB.js";
17
17
  import "./chunk-JT7R45JB.js";
@@ -9,13 +9,13 @@ import {
9
9
  enrichWorkspacesWithGithub,
10
10
  ensureGlobalCoordinatorCwd,
11
11
  formatWorkspaceInventory
12
- } from "./chunk-54RSAMBH.js";
13
- import "./chunk-RPX6VDW7.js";
12
+ } from "./chunk-LCU6GBZP.js";
13
+ import "./chunk-QSEF2YVQ.js";
14
14
  import "./chunk-D6JWYJ4P.js";
15
15
  import "./chunk-INNLWYXW.js";
16
16
  import "./chunk-SYFVUF2C.js";
17
17
  import "./chunk-FNQNJOHY.js";
18
- import "./chunk-ISV5IFH3.js";
18
+ import "./chunk-X743YN5Y.js";
19
19
  import "./chunk-NSTQ6QKD.js";
20
20
  import "./chunk-KGZBYWZ3.js";
21
21
  import "./chunk-EQNRWDLN.js";
@@ -17,13 +17,13 @@ import {
17
17
  orchestratorSessionPoisonedByBuiltins,
18
18
  slackCoordinatorSourceRef,
19
19
  takenTeamSlugsForOrchestration
20
- } from "./chunk-54RSAMBH.js";
21
- import "./chunk-RPX6VDW7.js";
20
+ } from "./chunk-LCU6GBZP.js";
21
+ import "./chunk-QSEF2YVQ.js";
22
22
  import "./chunk-D6JWYJ4P.js";
23
23
  import "./chunk-INNLWYXW.js";
24
24
  import "./chunk-SYFVUF2C.js";
25
25
  import "./chunk-FNQNJOHY.js";
26
- import "./chunk-ISV5IFH3.js";
26
+ import "./chunk-X743YN5Y.js";
27
27
  import "./chunk-NSTQ6QKD.js";
28
28
  import "./chunk-KGZBYWZ3.js";
29
29
  import {
@@ -15,11 +15,11 @@ import {
15
15
  orchestratorSessionPoisonedByBuiltins,
16
16
  slackCoordinatorSourceRef,
17
17
  takenTeamSlugsForOrchestration
18
- } from "./chunk-LJHC62LZ.js";
19
- import "./chunk-STPZQR5B.js";
18
+ } from "./chunk-TNDUTGDV.js";
19
+ import "./chunk-CMGRV36E.js";
20
20
  import "./chunk-6K64FJDD.js";
21
21
  import "./chunk-QQKDGPUI.js";
22
- import "./chunk-CXFW5LIH.js";
22
+ import "./chunk-QFBBUFD4.js";
23
23
  import "./chunk-4TR3HZFT.js";
24
24
  import "./chunk-WDRMZKVB.js";
25
25
  import "./chunk-JT7R45JB.js";