@sideboard-ai/core 0.1.132 → 0.1.135

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 (53) hide show
  1. package/dist/abletime-DDTV7WO3.js +36 -0
  2. package/dist/abletime-VTP4JR63.js +37 -0
  3. package/dist/{agents-LGJLZMM3.js → agents-O3AJMI2Y.js} +9 -8
  4. package/dist/{agents-CI6NGKRO.js → agents-RTQFF7PY.js} +9 -8
  5. package/dist/{app-settings-6RPALX4J.js → app-settings-U5RZKUXG.js} +11 -1
  6. package/dist/{app-settings-E7NEQY7D.js → app-settings-YQ7YX2CC.js} +11 -1
  7. package/dist/{chunk-MNL4FSKY.js → chunk-2ESCEK2Q.js} +4 -4
  8. package/dist/chunk-2XXAAIN3.js +463 -0
  9. package/dist/{chunk-HZPO3SSZ.js → chunk-57GIFU3X.js} +4 -3
  10. package/dist/chunk-6GN5WPYZ.js +31 -0
  11. package/dist/chunk-AT346U23.js +468 -0
  12. package/dist/{chunk-LLX3OMHU.js → chunk-ED4UPEJX.js} +1 -1
  13. package/dist/chunk-ELBYOGVA.js +32 -0
  14. package/dist/{chunk-HUYEU4GS.js → chunk-GJBHOJCZ.js} +83 -2
  15. package/dist/{chunk-ZND6XV6J.js → chunk-GKKHXZCT.js} +83 -2
  16. package/dist/{chunk-UDQI3N47.js → chunk-HQQNLDVC.js} +2 -2
  17. package/dist/{chunk-G6X6UFJO.js → chunk-J5IBSVB3.js} +42 -12
  18. package/dist/{chunk-RSFCB23A.js → chunk-K7EX47QG.js} +4 -3
  19. package/dist/{chunk-PK4PQUPU.js → chunk-KBBXNS2V.js} +6 -6
  20. package/dist/{chunk-SIPDL62B.js → chunk-KBWND62T.js} +6 -6
  21. package/dist/{chunk-VE22NWBD.js → chunk-LOKXPQ4U.js} +2 -2
  22. package/dist/{chunk-AQESMTCZ.js → chunk-M267JPEA.js} +3 -29
  23. package/dist/{chunk-MGYCQAZ6.js → chunk-N62K3KXX.js} +6 -6
  24. package/dist/{chunk-HLJUNJBF.js → chunk-PM3C2J6K.js} +42 -12
  25. package/dist/{chunk-HRSBZIXS.js → chunk-QAV3HGVS.js} +2 -2
  26. package/dist/{chunk-SYLTXDRF.js → chunk-RDULVW3E.js} +2 -2
  27. package/dist/{chunk-R7FGPBKL.js → chunk-S42XV45P.js} +3 -25
  28. package/dist/{chunk-VFXZTSAD.js → chunk-XIKEUCNC.js} +55 -31
  29. package/dist/{chunk-HULESWLI.js → chunk-XUEI4GCF.js} +4 -4
  30. package/dist/{chunk-SMWJAE74.js → chunk-Z5LYMW7M.js} +55 -31
  31. package/dist/{connected-teams-S6E3D5C7.js → connected-teams-4A2AXDNN.js} +3 -2
  32. package/dist/{connected-teams-3BWNJIRY.js → connected-teams-IJUJQ7R6.js} +3 -2
  33. package/dist/{coordinator-prompt-MEEUOEF2.js → coordinator-prompt-FYMWE33S.js} +4 -4
  34. package/dist/{coordinator-prompt-SPJSGAQS.js → coordinator-prompt-Y737IIFR.js} +4 -4
  35. package/dist/{global-workspace-KNESLWKG.js → global-workspace-6KH6BSKL.js} +5 -5
  36. package/dist/{global-workspace-BMWP7YZC.js → global-workspace-ZFKNLBZA.js} +5 -5
  37. package/dist/index.cjs +1150 -353
  38. package/dist/index.d.cts +173 -13
  39. package/dist/index.d.ts +173 -13
  40. package/dist/index.js +435 -240
  41. package/dist/mcp/run-stdio.cjs +1041 -300
  42. package/dist/mcp/run-stdio.js +339 -187
  43. package/dist/{oauth-FT7EL2PY.js → oauth-A7XXI2TM.js} +2 -1
  44. package/dist/{oauth-43NNH6C6.js → oauth-YJBAURIJ.js} +2 -1
  45. package/dist/{orchestrator-JA65XKB6.js → orchestrator-2BRAPJ47.js} +11 -10
  46. package/dist/{orchestrator-5TN2DJWO.js → orchestrator-3YDPPZHZ.js} +11 -10
  47. package/dist/{thread-store-5MLYY35S.js → thread-store-CRLQJ2HM.js} +3 -1
  48. package/dist/{thread-store-F6BCARQG.js → thread-store-FADXSMEJ.js} +3 -1
  49. package/dist/{workspaces-HSYRYJYV.js → workspaces-3RRF3LVF.js} +6 -6
  50. package/dist/{workspaces-O4QZOASB.js → workspaces-AYI5DHK4.js} +6 -6
  51. package/dist/{worktree-ERHC7Q4F.js → worktree-BC6XDMQK.js} +3 -3
  52. package/dist/{worktree-JVGSLSLJ.js → worktree-MX7XBX6Z.js} +3 -3
  53. package/package.json +1 -1
@@ -18,13 +18,13 @@ import {
18
18
  stripBrightsyNdjsonNoise,
19
19
  sumUsageList,
20
20
  toolDescription
21
- } from "./chunk-MGYCQAZ6.js";
21
+ } from "./chunk-N62K3KXX.js";
22
22
  import {
23
23
  addWorkspace,
24
24
  ensureWorkspace,
25
25
  removeWorkspace,
26
26
  syncWorkspacesFromThreads
27
- } from "./chunk-VE22NWBD.js";
27
+ } from "./chunk-LOKXPQ4U.js";
28
28
  import {
29
29
  assertOrchestratorCapableAgent,
30
30
  coerceOrchestratorAgent,
@@ -37,14 +37,14 @@ import {
37
37
  isOrchestratorThread,
38
38
  isSlackCoordinatorThread,
39
39
  orchestratorSessionPoisonedByBuiltins
40
- } from "./chunk-HULESWLI.js";
40
+ } from "./chunk-XUEI4GCF.js";
41
41
  import {
42
42
  SLACK_REPLY_FORMATTING,
43
43
  coordinatorSystemPrompt,
44
44
  coordinatorTurnReminder,
45
45
  enrichWorkspacesWithGithub,
46
46
  ensureGlobalCoordinatorCwd
47
- } from "./chunk-HZPO3SSZ.js";
47
+ } from "./chunk-57GIFU3X.js";
48
48
  import {
49
49
  extractPresentedPlan,
50
50
  readPlanFile,
@@ -114,7 +114,7 @@ import {
114
114
  withRepoGitLock,
115
115
  worktreeDisplayLabelForGroup,
116
116
  worktreeNameFromPath
117
- } from "./chunk-UDQI3N47.js";
117
+ } from "./chunk-HQQNLDVC.js";
118
118
  import {
119
119
  ATTACHMENTS_DIR,
120
120
  LEGACY_ATTACHMENTS_DIR,
@@ -122,6 +122,8 @@ import {
122
122
  } from "./chunk-FKOIHGKV.js";
123
123
  import {
124
124
  childEnvWithAppSettings,
125
+ getIssueSource,
126
+ isAbleTimeConnected,
125
127
  isSecureFileEncrypted,
126
128
  loadAppSettings,
127
129
  orchestrationQuotaFallbackAgent,
@@ -132,7 +134,7 @@ import {
132
134
  resolveVaultKey,
133
135
  updateAdvancedSettings,
134
136
  writeSecureJson
135
- } from "./chunk-HUYEU4GS.js";
137
+ } from "./chunk-GJBHOJCZ.js";
136
138
  import {
137
139
  stripNestedElectronEnv
138
140
  } from "./chunk-4TR3HZFT.js";
@@ -150,7 +152,7 @@ import {
150
152
  updateThread,
151
153
  withThreadLock,
152
154
  writeThread
153
- } from "./chunk-HLJUNJBF.js";
155
+ } from "./chunk-PM3C2J6K.js";
154
156
  import {
155
157
  appDataDir,
156
158
  findConventionSetup,
@@ -443,7 +445,7 @@ async function continueSourceThread(threadId, prompt) {
443
445
  await continueOnReply(threadId, prompt);
444
446
  return;
445
447
  }
446
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-5TN2DJWO.js");
448
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-3YDPPZHZ.js");
447
449
  await getOrchestrator2().send(threadId, prompt);
448
450
  } catch {
449
451
  }
@@ -723,9 +725,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
723
725
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
724
726
  );
725
727
  }
726
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-BMWP7YZC.js");
728
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-ZFKNLBZA.js");
727
729
  if (isGlobalThread2(thread)) {
728
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-MEEUOEF2.js");
730
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-FYMWE33S.js");
729
731
  ensureGlobalCoordinatorCwd2(
730
732
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
731
733
  );
@@ -2425,6 +2427,9 @@ function issueNeedsWorkspacePick(provider, workspaceCount) {
2425
2427
  if (workspaceCount <= 1) return false;
2426
2428
  return provider !== "github";
2427
2429
  }
2430
+ function isAccountWideIssueSource(source) {
2431
+ return source === "linear" || source === "abletime";
2432
+ }
2428
2433
  function boardPrKey(pr) {
2429
2434
  return pr.url?.trim() || `${pr.repoPath}::${pr.number}`;
2430
2435
  }
@@ -2767,7 +2772,7 @@ async function createThread(input, _onSetupLine) {
2767
2772
  });
2768
2773
  await requireAgent(resolved.agent);
2769
2774
  if (input.cowboy) {
2770
- const { cowboyModeEnabled } = await import("./app-settings-6RPALX4J.js");
2775
+ const { cowboyModeEnabled } = await import("./app-settings-U5RZKUXG.js");
2771
2776
  if (!cowboyModeEnabled()) {
2772
2777
  throw new Error(
2773
2778
  "Cowboy mode is off. Enable it in Settings \u2192 Advanced."
@@ -2815,11 +2820,29 @@ async function createThread(input, _onSetupLine) {
2815
2820
  await ensureWorkspace(repoPath);
2816
2821
  return readThread(thread2.id) ?? thread2;
2817
2822
  }
2823
+ let sourceType = input.sourceType;
2818
2824
  let sourceRef = input.sourceRef;
2825
+ let persistedSourceRef = input.sourceRef;
2826
+ let attachments = input.attachments ?? [];
2827
+ let title = input.title;
2819
2828
  let sourceIsFork = false;
2829
+ if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
2830
+ if (isAbleTimeConnected() && getIssueSource() === "abletime") {
2831
+ const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-DDTV7WO3.js");
2832
+ const task = await ensureAbleTimeTask({
2833
+ title: title?.trim() || "Untitled work",
2834
+ description: input.prompt?.trim() || void 0
2835
+ });
2836
+ sourceType = "ticket";
2837
+ sourceRef = task.identifier;
2838
+ persistedSourceRef = task.identifier;
2839
+ title = title?.trim() || task.title;
2840
+ attachments = [...attachments, issueAttachmentForAbleTimeTask(task)];
2841
+ }
2842
+ }
2820
2843
  let prUrl = null;
2821
2844
  let prTitle = null;
2822
- if (input.sourceType === "pr") {
2845
+ if (sourceType === "pr") {
2823
2846
  const num = Number(input.sourceRef.replace(/^#/, ""));
2824
2847
  if (!Number.isFinite(num)) throw new Error(`Invalid PR number: ${input.sourceRef}`);
2825
2848
  const pr = await getPr(repoPath, num);
@@ -2829,9 +2852,9 @@ async function createThread(input, _onSetupLine) {
2829
2852
  const localFetchBranch = `sideboard-pr-${pr.number}`;
2830
2853
  await fetchPrHead(repoPath, pr.number, localFetchBranch);
2831
2854
  sourceRef = localFetchBranch;
2832
- } else if (input.sourceType === "ticket") {
2855
+ } else if (sourceType === "ticket") {
2833
2856
  sourceRef = await resolveDefaultBranch(repoPath);
2834
- } else if (input.sourceType === "branch") {
2857
+ } else if (sourceType === "branch") {
2835
2858
  if (!sourceRef || sourceRef === "HEAD" || sourceRef === "default") {
2836
2859
  sourceRef = await resolveDefaultBranch(repoPath);
2837
2860
  } else {
@@ -2841,7 +2864,7 @@ async function createThread(input, _onSetupLine) {
2841
2864
  prTitle = existing.title;
2842
2865
  }
2843
2866
  }
2844
- } else if (input.sourceType === "adopt") {
2867
+ } else if (sourceType === "adopt") {
2845
2868
  throw new Error("Use adoptThread() for adopt sources");
2846
2869
  }
2847
2870
  const team = allocateTeamSlug(repoPath);
@@ -2851,12 +2874,12 @@ async function createThread(input, _onSetupLine) {
2851
2874
  slug: team.slug
2852
2875
  });
2853
2876
  copyConfiguredFiles(repoPath, worktreePath);
2854
- const explicitTitle = input.title?.trim();
2877
+ const explicitTitle = title?.trim();
2855
2878
  const thread = createEmptyThread({
2856
2879
  title: explicitTitle || team.name,
2857
2880
  userSetTitle: Boolean(explicitTitle),
2858
- sourceType: input.sourceType,
2859
- sourceRef: input.sourceRef === "default" ? sourceRef : input.sourceRef,
2881
+ sourceType,
2882
+ sourceRef: persistedSourceRef === "default" ? sourceRef : persistedSourceRef,
2860
2883
  branchName,
2861
2884
  worktreePath,
2862
2885
  repoPath,
@@ -2866,7 +2889,7 @@ async function createThread(input, _onSetupLine) {
2866
2889
  effort: resolved.effort,
2867
2890
  fast: resolved.fast,
2868
2891
  planMode: Boolean(input.planMode),
2869
- attachments: input.attachments ?? [],
2892
+ attachments,
2870
2893
  sourceIsFork,
2871
2894
  parentThreadId: input.parentThreadId ?? null,
2872
2895
  status: "idle",
@@ -2878,7 +2901,7 @@ async function createThread(input, _onSetupLine) {
2878
2901
  return readThread(thread.id) ?? thread;
2879
2902
  }
2880
2903
  async function listLinearIssues(agent, repoPath) {
2881
- const { getAdapter: getAdapter2 } = await import("./agents-CI6NGKRO.js");
2904
+ const { getAdapter: getAdapter2 } = await import("./agents-RTQFF7PY.js");
2882
2905
  await requireAgent(agent, { requireLinear: true });
2883
2906
  const adapter = getAdapter2(agent);
2884
2907
  if (!adapter.listLinearIssues) {
@@ -3275,7 +3298,7 @@ async function adoptThread(input) {
3275
3298
  messages: input.messages ?? []
3276
3299
  });
3277
3300
  writeThread(thread);
3278
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-O4QZOASB.js");
3301
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-AYI5DHK4.js");
3279
3302
  await ensureWorkspace2(repoPath);
3280
3303
  return thread;
3281
3304
  }
@@ -5549,7 +5572,7 @@ function formatScheduledPrompt(name, prompt) {
5549
5572
  ${prompt}`;
5550
5573
  }
5551
5574
  async function defaultDeps() {
5552
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-5TN2DJWO.js");
5575
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-3YDPPZHZ.js");
5553
5576
  const orch = getOrchestrator2();
5554
5577
  return {
5555
5578
  findThread: (id) => findThreadByRef(id),
@@ -5774,7 +5797,7 @@ var Orchestrator = class {
5774
5797
  orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
5775
5798
  });
5776
5799
  }
5777
- const { autoCleanupOrphansEnabled } = await import("./app-settings-6RPALX4J.js");
5800
+ const { autoCleanupOrphansEnabled } = await import("./app-settings-U5RZKUXG.js");
5778
5801
  if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
5779
5802
  await cleanupOrphanWorktrees({ repoPaths });
5780
5803
  }
@@ -5985,7 +6008,7 @@ var Orchestrator = class {
5985
6008
  }
5986
6009
  await setup;
5987
6010
  if (skipSetup) return;
5988
- const { autoRunAfterSetupEnabled } = await import("./app-settings-6RPALX4J.js");
6011
+ const { autoRunAfterSetupEnabled } = await import("./app-settings-U5RZKUXG.js");
5989
6012
  if (autoRunAfterSetupEnabled()) {
5990
6013
  try {
5991
6014
  await this.startDev(threadId);
@@ -6275,7 +6298,7 @@ var Orchestrator = class {
6275
6298
  }
6276
6299
  const isBrightsy = fresh.agent === "brightsy";
6277
6300
  const isOrchestration = isOrchestratorThread(fresh);
6278
- const { autoRenameBranchEnabled, getGithubGitAuthMode } = await import("./app-settings-6RPALX4J.js");
6301
+ const { autoRenameBranchEnabled, getGithubGitAuthMode } = await import("./app-settings-U5RZKUXG.js");
6279
6302
  const gitAuthMode = getGithubGitAuthMode();
6280
6303
  const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
6281
6304
  githubSlug: await resolveGithubRepoSlug(fresh.worktreePath).catch(
@@ -7078,7 +7101,7 @@ var Orchestrator = class {
7078
7101
  updateThread(thread.id, { title: meta.title });
7079
7102
  }
7080
7103
  }
7081
- const { autoArchiveOnMergeEnabled } = await import("./app-settings-6RPALX4J.js");
7104
+ const { autoArchiveOnMergeEnabled } = await import("./app-settings-U5RZKUXG.js");
7082
7105
  const latest = this.requireThread(thread.id);
7083
7106
  if (!shouldAutoArchiveOnPrMerge({
7084
7107
  previousPrState: prevState || null,
@@ -7388,7 +7411,7 @@ var Orchestrator = class {
7388
7411
  this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
7389
7412
  if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
7390
7413
  try {
7391
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-O4QZOASB.js");
7414
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-AYI5DHK4.js");
7392
7415
  await ensureWorkspace2(thread.repoPath);
7393
7416
  } catch {
7394
7417
  }
@@ -7415,7 +7438,7 @@ var Orchestrator = class {
7415
7438
  await runArchiveScript(thread.repoPath, thread.worktreePath);
7416
7439
  } catch {
7417
7440
  }
7418
- const { deleteBranchOnPurgeEnabled } = await import("./app-settings-6RPALX4J.js");
7441
+ const { deleteBranchOnPurgeEnabled } = await import("./app-settings-U5RZKUXG.js");
7419
7442
  const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
7420
7443
  await removeWorktree(thread.repoPath, thread.worktreePath, {
7421
7444
  deleteBranch: deleteBranch ? thread.branchName : void 0
@@ -7442,7 +7465,7 @@ var Orchestrator = class {
7442
7465
  `Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
7443
7466
  );
7444
7467
  }
7445
- const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-JVGSLSLJ.js");
7468
+ const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-MX7XBX6Z.js");
7446
7469
  const slug = thread.worktreePath.split("/").pop();
7447
7470
  const dest = thread.worktreePath;
7448
7471
  await withRepoGitLock(thread.repoPath, async () => {
@@ -7550,7 +7573,7 @@ async function startOrchestration(opts) {
7550
7573
  sourceRef: "default",
7551
7574
  ...createOpts
7552
7575
  }).catch(async () => {
7553
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-JVGSLSLJ.js");
7576
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-MX7XBX6Z.js");
7554
7577
  const repo = await resolveRepoRoot2(repoPath);
7555
7578
  const def = await resolveDefaultBranch2(repo);
7556
7579
  return orch.createThread({
@@ -7560,7 +7583,7 @@ async function startOrchestration(opts) {
7560
7583
  repoPath: repo
7561
7584
  });
7562
7585
  });
7563
- const { updateThread: upd } = await import("./thread-store-5MLYY35S.js");
7586
+ const { updateThread: upd } = await import("./thread-store-CRLQJ2HM.js");
7564
7587
  const updated = upd(thread.id, {
7565
7588
  sourceType: "orchestration",
7566
7589
  sourceRef: goal
@@ -7691,6 +7714,7 @@ export {
7691
7714
  worktreeBoardStatus,
7692
7715
  dedupeBoardIssues,
7693
7716
  issueNeedsWorkspacePick,
7717
+ isAccountWideIssueSource,
7694
7718
  findLiveThreadForCreate,
7695
7719
  boardPinIdentity,
7696
7720
  findBoardPin,
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  ensureGlobalCoordinatorCwd
3
- } from "./chunk-HZPO3SSZ.js";
3
+ } from "./chunk-57GIFU3X.js";
4
4
  import {
5
5
  allocateTeamName,
6
6
  takenSlugsFromThread,
7
7
  teamSlugFromName
8
- } from "./chunk-UDQI3N47.js";
8
+ } from "./chunk-HQQNLDVC.js";
9
9
  import {
10
10
  resolveNewThreadOptions,
11
11
  resolveThreadDefaults
12
- } from "./chunk-HUYEU4GS.js";
12
+ } from "./chunk-GJBHOJCZ.js";
13
13
  import {
14
14
  createEmptyThread,
15
15
  listThreads,
16
16
  updateThread,
17
17
  writeThread
18
- } from "./chunk-HLJUNJBF.js";
18
+ } from "./chunk-PM3C2J6K.js";
19
19
  import {
20
20
  globalAgentCwd
21
21
  } from "./chunk-QZQEXME2.js";
@@ -31,13 +31,13 @@ import {
31
31
  summarizeTurnStderr,
32
32
  toolDescription,
33
33
  turnFailChatText
34
- } from "./chunk-PK4PQUPU.js";
34
+ } from "./chunk-KBBXNS2V.js";
35
35
  import {
36
36
  addWorkspace,
37
37
  ensureWorkspace,
38
38
  removeWorkspace,
39
39
  syncWorkspacesFromThreads
40
- } from "./chunk-SYLTXDRF.js";
40
+ } from "./chunk-RDULVW3E.js";
41
41
  import {
42
42
  extractPresentedPlan,
43
43
  readPlanFile,
@@ -58,14 +58,14 @@ import {
58
58
  isOrchestratorThread,
59
59
  isSlackCoordinatorThread,
60
60
  orchestratorSessionPoisonedByBuiltins
61
- } from "./chunk-MNL4FSKY.js";
61
+ } from "./chunk-2ESCEK2Q.js";
62
62
  import {
63
63
  SLACK_REPLY_FORMATTING,
64
64
  coordinatorSystemPrompt,
65
65
  coordinatorTurnReminder,
66
66
  enrichWorkspacesWithGithub,
67
67
  ensureGlobalCoordinatorCwd
68
- } from "./chunk-RSFCB23A.js";
68
+ } from "./chunk-K7EX47QG.js";
69
69
  import {
70
70
  addPrStackLayer,
71
71
  allocateTeamName,
@@ -110,7 +110,7 @@ import {
110
110
  withRepoGitLock,
111
111
  worktreeDisplayLabelForGroup,
112
112
  worktreeNameFromPath
113
- } from "./chunk-HRSBZIXS.js";
113
+ } from "./chunk-QAV3HGVS.js";
114
114
  import {
115
115
  ATTACHMENTS_DIR,
116
116
  LEGACY_ATTACHMENTS_DIR,
@@ -127,7 +127,7 @@ import {
127
127
  updateThread,
128
128
  withThreadLock,
129
129
  writeThread
130
- } from "./chunk-G6X6UFJO.js";
130
+ } from "./chunk-J5IBSVB3.js";
131
131
  import {
132
132
  clearStaleIndexLocks,
133
133
  enrichPathWithNpmGlobalBin,
@@ -138,6 +138,8 @@ import {
138
138
  } from "./chunk-KPIYENTF.js";
139
139
  import {
140
140
  childEnvWithAppSettings,
141
+ getIssueSource,
142
+ isAbleTimeConnected,
141
143
  isSecureFileEncrypted,
142
144
  loadAppSettings,
143
145
  orchestrationQuotaFallbackAgent,
@@ -149,7 +151,7 @@ import {
149
151
  stripNestedElectronEnv,
150
152
  updateAdvancedSettings,
151
153
  writeSecureJson
152
- } from "./chunk-ZND6XV6J.js";
154
+ } from "./chunk-GKKHXZCT.js";
153
155
  import {
154
156
  writePrivateFile
155
157
  } from "./chunk-NSTQ6QKD.js";
@@ -382,7 +384,7 @@ async function continueSourceThread(threadId, prompt) {
382
384
  await continueOnReply(threadId, prompt);
383
385
  return;
384
386
  }
385
- const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-JA65XKB6.js");
387
+ const { getOrchestrator: getOrchestrator2 } = await import("./orchestrator-2BRAPJ47.js");
386
388
  await getOrchestrator2().send(threadId, prompt);
387
389
  } catch {
388
390
  }
@@ -723,9 +725,9 @@ async function spawnAgentTurn(thread, input, onEvent) {
723
725
  `Cannot spawn ${thread.agent}: thread ${thread.id} has no worktreePath`
724
726
  );
725
727
  }
726
- const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-KNESLWKG.js");
728
+ const { isGlobalThread: isGlobalThread2 } = await import("./global-workspace-6KH6BSKL.js");
727
729
  if (isGlobalThread2(thread)) {
728
- const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-SPJSGAQS.js");
730
+ const { ensureGlobalCoordinatorCwd: ensureGlobalCoordinatorCwd2 } = await import("./coordinator-prompt-Y737IIFR.js");
729
731
  ensureGlobalCoordinatorCwd2(
730
732
  isOrchestratorThread(thread) ? { orchestratorThreadId: thread.id } : void 0
731
733
  );
@@ -2393,6 +2395,9 @@ function issueNeedsWorkspacePick(provider, workspaceCount) {
2393
2395
  if (workspaceCount <= 1) return false;
2394
2396
  return provider !== "github";
2395
2397
  }
2398
+ function isAccountWideIssueSource(source) {
2399
+ return source === "linear" || source === "abletime";
2400
+ }
2396
2401
  function boardPrKey(pr) {
2397
2402
  return pr.url?.trim() || `${pr.repoPath}::${pr.number}`;
2398
2403
  }
@@ -2728,7 +2733,7 @@ async function createThread(input, _onSetupLine) {
2728
2733
  });
2729
2734
  await requireAgent(resolved.agent);
2730
2735
  if (input.cowboy) {
2731
- const { cowboyModeEnabled } = await import("./app-settings-E7NEQY7D.js");
2736
+ const { cowboyModeEnabled } = await import("./app-settings-YQ7YX2CC.js");
2732
2737
  if (!cowboyModeEnabled()) {
2733
2738
  throw new Error(
2734
2739
  "Cowboy mode is off. Enable it in Settings \u2192 Advanced."
@@ -2776,11 +2781,29 @@ async function createThread(input, _onSetupLine) {
2776
2781
  await ensureWorkspace(repoPath);
2777
2782
  return readThread(thread2.id) ?? thread2;
2778
2783
  }
2784
+ let sourceType = input.sourceType;
2779
2785
  let sourceRef = input.sourceRef;
2786
+ let persistedSourceRef = input.sourceRef;
2787
+ let attachments = input.attachments ?? [];
2788
+ let title = input.title;
2780
2789
  let sourceIsFork = false;
2790
+ if (!input.cowboy && sourceType === "branch" && (!sourceRef || sourceRef === "HEAD" || sourceRef === "default")) {
2791
+ if (isAbleTimeConnected() && getIssueSource() === "abletime") {
2792
+ const { ensureAbleTimeTask, issueAttachmentForAbleTimeTask } = await import("./abletime-VTP4JR63.js");
2793
+ const task = await ensureAbleTimeTask({
2794
+ title: title?.trim() || "Untitled work",
2795
+ description: input.prompt?.trim() || void 0
2796
+ });
2797
+ sourceType = "ticket";
2798
+ sourceRef = task.identifier;
2799
+ persistedSourceRef = task.identifier;
2800
+ title = title?.trim() || task.title;
2801
+ attachments = [...attachments, issueAttachmentForAbleTimeTask(task)];
2802
+ }
2803
+ }
2781
2804
  let prUrl = null;
2782
2805
  let prTitle = null;
2783
- if (input.sourceType === "pr") {
2806
+ if (sourceType === "pr") {
2784
2807
  const num = Number(input.sourceRef.replace(/^#/, ""));
2785
2808
  if (!Number.isFinite(num)) throw new Error(`Invalid PR number: ${input.sourceRef}`);
2786
2809
  const pr = await getPr(repoPath, num);
@@ -2790,9 +2813,9 @@ async function createThread(input, _onSetupLine) {
2790
2813
  const localFetchBranch = `sideboard-pr-${pr.number}`;
2791
2814
  await fetchPrHead(repoPath, pr.number, localFetchBranch);
2792
2815
  sourceRef = localFetchBranch;
2793
- } else if (input.sourceType === "ticket") {
2816
+ } else if (sourceType === "ticket") {
2794
2817
  sourceRef = await resolveDefaultBranch(repoPath);
2795
- } else if (input.sourceType === "branch") {
2818
+ } else if (sourceType === "branch") {
2796
2819
  if (!sourceRef || sourceRef === "HEAD" || sourceRef === "default") {
2797
2820
  sourceRef = await resolveDefaultBranch(repoPath);
2798
2821
  } else {
@@ -2802,7 +2825,7 @@ async function createThread(input, _onSetupLine) {
2802
2825
  prTitle = existing.title;
2803
2826
  }
2804
2827
  }
2805
- } else if (input.sourceType === "adopt") {
2828
+ } else if (sourceType === "adopt") {
2806
2829
  throw new Error("Use adoptThread() for adopt sources");
2807
2830
  }
2808
2831
  const team = allocateTeamSlug(repoPath);
@@ -2812,12 +2835,12 @@ async function createThread(input, _onSetupLine) {
2812
2835
  slug: team.slug
2813
2836
  });
2814
2837
  copyConfiguredFiles(repoPath, worktreePath);
2815
- const explicitTitle = input.title?.trim();
2838
+ const explicitTitle = title?.trim();
2816
2839
  const thread = createEmptyThread({
2817
2840
  title: explicitTitle || team.name,
2818
2841
  userSetTitle: Boolean(explicitTitle),
2819
- sourceType: input.sourceType,
2820
- sourceRef: input.sourceRef === "default" ? sourceRef : input.sourceRef,
2842
+ sourceType,
2843
+ sourceRef: persistedSourceRef === "default" ? sourceRef : persistedSourceRef,
2821
2844
  branchName,
2822
2845
  worktreePath,
2823
2846
  repoPath,
@@ -2827,7 +2850,7 @@ async function createThread(input, _onSetupLine) {
2827
2850
  effort: resolved.effort,
2828
2851
  fast: resolved.fast,
2829
2852
  planMode: Boolean(input.planMode),
2830
- attachments: input.attachments ?? [],
2853
+ attachments,
2831
2854
  sourceIsFork,
2832
2855
  parentThreadId: input.parentThreadId ?? null,
2833
2856
  status: "idle",
@@ -2839,7 +2862,7 @@ async function createThread(input, _onSetupLine) {
2839
2862
  return readThread(thread.id) ?? thread;
2840
2863
  }
2841
2864
  async function listLinearIssues(agent, repoPath) {
2842
- const { getAdapter: getAdapter2 } = await import("./agents-LGJLZMM3.js");
2865
+ const { getAdapter: getAdapter2 } = await import("./agents-O3AJMI2Y.js");
2843
2866
  await requireAgent(agent, { requireLinear: true });
2844
2867
  const adapter = getAdapter2(agent);
2845
2868
  if (!adapter.listLinearIssues) {
@@ -3236,7 +3259,7 @@ async function adoptThread(input) {
3236
3259
  messages: input.messages ?? []
3237
3260
  });
3238
3261
  writeThread(thread);
3239
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-HSYRYJYV.js");
3262
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-3RRF3LVF.js");
3240
3263
  await ensureWorkspace2(repoPath);
3241
3264
  return thread;
3242
3265
  }
@@ -5384,7 +5407,7 @@ function formatScheduledPrompt(name, prompt) {
5384
5407
  ${prompt}`;
5385
5408
  }
5386
5409
  async function defaultDeps() {
5387
- const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-JA65XKB6.js");
5410
+ const { getOrchestrator: getOrchestrator2, startOrchestration: startOrchestration2 } = await import("./orchestrator-2BRAPJ47.js");
5388
5411
  const orch = getOrchestrator2();
5389
5412
  return {
5390
5413
  findThread: (id) => findThreadByRef(id),
@@ -5609,7 +5632,7 @@ var Orchestrator = class {
5609
5632
  orphans: orphans.map((o) => ({ path: o.path, repoPath: o.repoPath }))
5610
5633
  });
5611
5634
  }
5612
- const { autoCleanupOrphansEnabled } = await import("./app-settings-E7NEQY7D.js");
5635
+ const { autoCleanupOrphansEnabled } = await import("./app-settings-YQ7YX2CC.js");
5613
5636
  if (autoCleanupOrphansEnabled() && shouldRunWorktreeCleanup() && orphans.length > 0) {
5614
5637
  await cleanupOrphanWorktrees({ repoPaths });
5615
5638
  }
@@ -5820,7 +5843,7 @@ var Orchestrator = class {
5820
5843
  }
5821
5844
  await setup;
5822
5845
  if (skipSetup) return;
5823
- const { autoRunAfterSetupEnabled } = await import("./app-settings-E7NEQY7D.js");
5846
+ const { autoRunAfterSetupEnabled } = await import("./app-settings-YQ7YX2CC.js");
5824
5847
  if (autoRunAfterSetupEnabled()) {
5825
5848
  try {
5826
5849
  await this.startDev(threadId);
@@ -6110,7 +6133,7 @@ var Orchestrator = class {
6110
6133
  }
6111
6134
  const isBrightsy = fresh.agent === "brightsy";
6112
6135
  const isOrchestration = isOrchestratorThread(fresh);
6113
- const { autoRenameBranchEnabled, getGithubGitAuthMode } = await import("./app-settings-E7NEQY7D.js");
6136
+ const { autoRenameBranchEnabled, getGithubGitAuthMode } = await import("./app-settings-YQ7YX2CC.js");
6114
6137
  const gitAuthMode = getGithubGitAuthMode();
6115
6138
  const worktreeDirective = isBrightsy || isOrchestration ? null : formatWorktreeDirective(fresh, {
6116
6139
  githubSlug: await resolveGithubRepoSlug(fresh.worktreePath).catch(
@@ -6913,7 +6936,7 @@ var Orchestrator = class {
6913
6936
  updateThread(thread.id, { title: meta.title });
6914
6937
  }
6915
6938
  }
6916
- const { autoArchiveOnMergeEnabled } = await import("./app-settings-E7NEQY7D.js");
6939
+ const { autoArchiveOnMergeEnabled } = await import("./app-settings-YQ7YX2CC.js");
6917
6940
  const latest = this.requireThread(thread.id);
6918
6941
  if (!shouldAutoArchiveOnPrMerge({
6919
6942
  previousPrState: prevState || null,
@@ -7223,7 +7246,7 @@ var Orchestrator = class {
7223
7246
  this.emit({ type: "status_changed", threadId: archived.id, status: "archived" });
7224
7247
  if (thread.repoPath && !isGlobalRepoPath(thread.repoPath)) {
7225
7248
  try {
7226
- const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-HSYRYJYV.js");
7249
+ const { ensureWorkspace: ensureWorkspace2 } = await import("./workspaces-3RRF3LVF.js");
7227
7250
  await ensureWorkspace2(thread.repoPath);
7228
7251
  } catch {
7229
7252
  }
@@ -7250,7 +7273,7 @@ var Orchestrator = class {
7250
7273
  await runArchiveScript(thread.repoPath, thread.worktreePath);
7251
7274
  } catch {
7252
7275
  }
7253
- const { deleteBranchOnPurgeEnabled } = await import("./app-settings-E7NEQY7D.js");
7276
+ const { deleteBranchOnPurgeEnabled } = await import("./app-settings-YQ7YX2CC.js");
7254
7277
  const deleteBranch = opts?.deleteBranch ?? deleteBranchOnPurgeEnabled();
7255
7278
  await removeWorktree(thread.repoPath, thread.worktreePath, {
7256
7279
  deleteBranch: deleteBranch ? thread.branchName : void 0
@@ -7277,7 +7300,7 @@ var Orchestrator = class {
7277
7300
  `Cowboy checkout missing: ${thread.worktreePath}. Re-add the project folder, then restore.`
7278
7301
  );
7279
7302
  }
7280
- const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-ERHC7Q4F.js");
7303
+ const { createThreadWorktree: createThreadWorktree2 } = await import("./worktree-BC6XDMQK.js");
7281
7304
  const slug = thread.worktreePath.split("/").pop();
7282
7305
  const dest = thread.worktreePath;
7283
7306
  await withRepoGitLock(thread.repoPath, async () => {
@@ -7385,7 +7408,7 @@ async function startOrchestration(opts) {
7385
7408
  sourceRef: "default",
7386
7409
  ...createOpts
7387
7410
  }).catch(async () => {
7388
- const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-ERHC7Q4F.js");
7411
+ const { resolveDefaultBranch: resolveDefaultBranch2, resolveRepoRoot: resolveRepoRoot2 } = await import("./worktree-BC6XDMQK.js");
7389
7412
  const repo = await resolveRepoRoot2(repoPath);
7390
7413
  const def = await resolveDefaultBranch2(repo);
7391
7414
  return orch.createThread({
@@ -7395,7 +7418,7 @@ async function startOrchestration(opts) {
7395
7418
  repoPath: repo
7396
7419
  });
7397
7420
  });
7398
- const { updateThread: upd } = await import("./thread-store-F6BCARQG.js");
7421
+ const { updateThread: upd } = await import("./thread-store-FADXSMEJ.js");
7399
7422
  const updated = upd(thread.id, {
7400
7423
  sourceType: "orchestration",
7401
7424
  sourceRef: goal
@@ -7419,6 +7442,7 @@ export {
7419
7442
  HOME_BOARD_CACHE_TTL_MS,
7420
7443
  dedupeBoardIssues,
7421
7444
  issueNeedsWorkspacePick,
7445
+ isAccountWideIssueSource,
7422
7446
  findLiveThreadForCreate,
7423
7447
  findBoardPin,
7424
7448
  syncBoardPins,
@@ -7,8 +7,9 @@ import {
7
7
  ensureConnectedBrightsyTeamTokens,
8
8
  getConnectedBrightsyTeamsRaw,
9
9
  listConnectedBrightsyTeams
10
- } from "./chunk-SIPDL62B.js";
11
- import "./chunk-AQESMTCZ.js";
10
+ } from "./chunk-KBWND62T.js";
11
+ import "./chunk-M267JPEA.js";
12
+ import "./chunk-ELBYOGVA.js";
12
13
  import "./chunk-QZQEXME2.js";
13
14
  import "./chunk-DVM4ID64.js";
14
15
  export {
@@ -9,8 +9,9 @@ import {
9
9
  ensureConnectedBrightsyTeamTokens,
10
10
  getConnectedBrightsyTeamsRaw,
11
11
  listConnectedBrightsyTeams
12
- } from "./chunk-LLX3OMHU.js";
13
- import "./chunk-R7FGPBKL.js";
12
+ } from "./chunk-ED4UPEJX.js";
13
+ import "./chunk-S42XV45P.js";
14
+ import "./chunk-6GN5WPYZ.js";
14
15
  import "./chunk-KPIYENTF.js";
15
16
  import "./chunk-BD2ICC4D.js";
16
17
  export {
@@ -7,13 +7,13 @@ import {
7
7
  enrichWorkspacesWithGithub,
8
8
  ensureGlobalCoordinatorCwd,
9
9
  formatWorkspaceInventory
10
- } from "./chunk-HZPO3SSZ.js";
11
- import "./chunk-UDQI3N47.js";
10
+ } from "./chunk-57GIFU3X.js";
11
+ import "./chunk-HQQNLDVC.js";
12
12
  import "./chunk-FKOIHGKV.js";
13
- import "./chunk-HUYEU4GS.js";
13
+ import "./chunk-GJBHOJCZ.js";
14
14
  import "./chunk-4TR3HZFT.js";
15
15
  import "./chunk-JT7R45JB.js";
16
- import "./chunk-HLJUNJBF.js";
16
+ import "./chunk-PM3C2J6K.js";
17
17
  import "./chunk-77WWLBCI.js";
18
18
  import "./chunk-QZQEXME2.js";
19
19
  import "./chunk-DVM4ID64.js";
@@ -9,12 +9,12 @@ import {
9
9
  enrichWorkspacesWithGithub,
10
10
  ensureGlobalCoordinatorCwd,
11
11
  formatWorkspaceInventory
12
- } from "./chunk-RSFCB23A.js";
13
- import "./chunk-HRSBZIXS.js";
12
+ } from "./chunk-K7EX47QG.js";
13
+ import "./chunk-QAV3HGVS.js";
14
14
  import "./chunk-B3SJXYIJ.js";
15
- import "./chunk-G6X6UFJO.js";
15
+ import "./chunk-J5IBSVB3.js";
16
16
  import "./chunk-KPIYENTF.js";
17
- import "./chunk-ZND6XV6J.js";
17
+ import "./chunk-GKKHXZCT.js";
18
18
  import "./chunk-NSTQ6QKD.js";
19
19
  import "./chunk-KGZBYWZ3.js";
20
20
  import "./chunk-BD2ICC4D.js";